Thread: startswith ?
View Single Post
  #3  
Old 08-14-2002, 04:39 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
X.X this is Projectshifter btw, my account is not working!

startswith would be used like if you want to make like a warpto script:
NPC Code:

if (playerchats && startswith(#c,warp))
{ tokenize #c;
this.x=#t(1);
this.y=#t(2);
setstring client.level,#t(3);
freezeplayer 1;
sleep 1;
setlevel2 this.x,this.y,#s(client.level);
}



a bit of extra stuff, but it says that if the string starts with what you specify. Your string:
NPC Code:

if (startswith(#L,level)){say2 You are in level-blah.graal;}


would make it so that if the level started with level then it would perform the action. #L needs to be capital, and it does the Level of the NPC, on an NPC Server you would want to use #F. You need to put a second end paranthese ')' to end the if statement not just the startswith.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote