View Single Post
  #6  
Old 10-27-2001, 10:53 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
So tokenize ok (just show tokenize not tokenize2 if he knows the first the 2end is no problem either)


say u have a string like this:

blupp=I am a bastard

so if u do

tokenize #s(blupp);

every word is a token u can read from #t()
here it would be like this:
#t(0) = I
#t(1) = am
#t(2) = a
#t(3) = bastard

it's usefull if u wanna do a warper for example:

if(playerchats && startswith(warpto,#c)){
tokenize #c;
setlevel2 #t(1),strtofloat(#t(2)),strtofloat(#t(3));
}

useage: say warpto levelname x-pos ypos

u can read out how many tokens are made with the variable tokenscount for example
if(playerchats){
tokenize #c;
}
for(this.i=0;this.i < tokenscount;this.i++){
setstring sayed,#s(sayed) #t(this.i);
}

silly example but so u could write every token into this string (I used it for an hotel where u can buy a room and I use only one serverstring because of tokens =D)
__________________
No Webhost at the moment
Reply With Quote