View Single Post
  #8  
Old 06-16-2003, 07:41 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Alexander
.................................................. ......
The script looks like that with the mistakes because I was trying to prove that I could script a much shorter version of someone's script using the same "layout" as in functions inside events, etc. That script was also updated 3 days ago, and is far from the same script here.
Do you not understand that functions should NOT be placed within events? Hell, while loops would even be better....

NPC Code:

//#CLIENTSIDE
if (created) {
setstring this.nocurse_r1,pls,plz,brb,;
setstring this.nocurse_r2,please,please,"Be right back",;
setstring this.nocurse_p1,PUT,YOUR,CURSE,WORDS,HERE;
}
if (playerchats) {

while (this.i_rl < strlen(#c)) {
for (i=0; i<sarraylen(this.nocurse_r1); i++) {
this.i_r1 = indexof(#I(this.nocurse_r1,i),#c);
if (this.i_r1 > -1) {
setstring this.nocurse_ts,#e(0,strtofloat(#v(this.i_r1)),#c) #I(this.nocurse_r2,i)#e(strtofloat(#v(this.i_r1))+ strlen(#I(this.nocurse_r2,i))-3,-1,#c);
setplayerprop #c,#s(this.nocurse_ts);
}
}
}

while (this.i_p1 < strlen(#c)) {
for (u=0; u<sarraylen(this.nocurse_p1); u++) {
this.i_p1 = indexof(#I(this.nocurse_p1,u),#c);
if (this.i_p1 > -1) {
setstring this.nocurse_st,;
for (o=0; o<strlen(#I(this.nocurse_p1,u)); o++) setstring this.nocurse_st,#s(this.nocurse_st)*;
setstring this.nocurse_ts,#e(0,strtofloat(#v(this.i_p1)),#c) #s(this.nocurse_st)#e(strtofloat(#v(this.i_p1))+st rlen(#s(this.nocurse_st)),-1,#c);
setplayerprop #c,#s(this.nocurse_ts);
}
}
this.i_rl = 0;
this.i_p1 = 0;

}




You have to realize that most of the scripters here are trying to help you become a better scripter, not trying to keep you down. Listen to them every once in awhile.
__________________
[signature]insert here[/signature]
Reply With Quote