Quote:
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);
}
|
tokenize #c;
divides str [#c] into words (tokens) which can be read with
#t(index)
so for example:
if (playerenters||timeout) {
message #v(this.x);
timeout=.05;
}
if (playerchats) {tokenize #c;
this.x=strtofloat(#t(6));
}
and i said "HELLO Frank, how are you? Im 8"
this.x would equal 8
also notice the strtofloat on #t(6), its cause i already knew that index of 6 would be a number... just an example to get u started...
index always starts from 0