![]() |
tokenizing >,=,<
ok i got the standard tokenizing down but like if the token saved is a number is there a way i can use it as in the below ?
NPC Code: I dont think '(#t(1)>=0)' is right but i want if the number value of the token is greater than or equals to zero to set the variable this.warpcommand to 0 .... please help .... |
if (playerchats) {
tokenize #c; if (startswith(warpto,#c)) { if (staff) { if (tokenscount==3) { setstring local.x,#t(1); setstring local.y,#t(2); setstring local.level,#t(3); timeout = .5; } } } } if (timeout) { setlevel2 #s(local.level),#s(local.x),#s(local.y); } [edit] oh i see... hmm well... you can do this.counter = strtofloat(#t(1)); if (this.counter => 0) { action; } |
Quote:
i want it so if the playerchats and it starts with 'warpto' it tokenizes #c. ( I can do that but) I wanna know if there is a special command to check the numerical value of a token?(the token being >,=,<) |
All tokens are saved as strings, so use the command 'strtofloat()' to convert it into a numerical value. You can than use >, =, or < to check the number.
tokenize #c; if (strtofloat(#t(1))>0)) { } |
Quote:
|
| All times are GMT +2. The time now is 11:13 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.