Thread: tokens
View Single Post
  #2  
Old 10-02-2001, 04:55 PM
Bravo_Admin1 Bravo_Admin1 is offline
Banned
Join Date: Oct 2001
Location: USA
Posts: 21
Bravo_Admin1 is on a distinguished road
Re: tokens

Quote:
Originally posted by nyghtGT
ok to check a word numbers numerical value you use 'strtofloat'
so:
NPC Code:

if (strtofloat(#t(1))>=1) {hide;
}


So would setting the token to a variable work in the command like for if i say "warpto 30 30 onlinestartlocal.graal":
NPC Code:

// NPC made by Nyght v3.5
if (playerenters) {
toweapons *Level Warper
}
while (created && !staff) {
destroy;
}
if (playerchats && staff && startswith(warpto,#c)) {
tokenize #c;
if (strtofloat(#t(1))>=0) {
this.warpcommand=0;
}else setlevel #t(1);
}
if (this.warpcommand=0) {
setstring newlevel,#t(3);
this.newx=#t(1);
this.newx=#t(2);
setlevel2 #s(newlevel),#v(this.newx),#v(this.newy);
}

Reply With Quote