Thread: startswith ?
View Single Post
  #6  
Old 08-14-2002, 04:57 AM
RavenTelvecho RavenTelvecho is offline
Registered User
RavenTelvecho's Avatar
Join Date: Apr 2002
Location: Toronto, Ontario, Canada
Posts: 0
RavenTelvecho is on a distinguished road
Send a message via ICQ to RavenTelvecho Send a message via AIM to RavenTelvecho Send a message via Yahoo to RavenTelvecho
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
__________________

^tuff newbie ;x
RavenTelvecho
!Booj
we are 'brothers'

Last edited by RavenTelvecho; 08-14-2002 at 05:09 AM..
Reply With Quote