View Single Post
  #1  
Old 10-27-2001, 03:03 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by TDO2000
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)
I allready knew how to use em but that is one very good explanation ...
Reply With Quote