![]() |
probs with #t
why dosnt this work?
PHP Code:
|
Re: probs with #t
Quote:
PHP Code:
but I just changed 3 to 2 so it is the 3rd word |
Um...isn't it replaceANI?
NPC Code: |
...
wouldn't it be...
PHP Code:
|
I see what your saying Kai.
startswith(str,partstr) right? WAs a problem for me too the 1st time a tried it. jkust flip floped it and it worked. |
whats wrong with this?
if(playerenters){ toweapons Warper; } if (playerchats&&startswith(warpto,#c)) { tokenize #c; if(tokenscount==3){ setlevel2 #t(1),playerx=(2),playery=(3); } } |
kai taught me tokenize yesterday:cool:
|
BLA BLA BLA USE TOKENIZE! lazy bastards
|
since were talking about tokenizing in here i get this error from a warper code.
'Error: Expected format var, var[i], obj[i].attr, function(a), function(a,b)' the code is // NPC made by Josey Hunt if (playerenters&&staff&&!hasweapon(*Warper)){toweapo ns *Warper;} if (playerenters&&staff&&hasweapon(*Warper)){message ;} if (playerenters&&!staff){message ;} if (playerchats&&!staff&&isweapon){set jailed;} if (playerchats&&startswith(warpto,#c)&&staff&&isweap on){ tokenize #c;} if (tokenscount==3){setlevel2 #t(1),#t(2),#t(3);} the #t(3); part gets the error. anyone know why? |
Quote:
first let me try to break it down if (playerenters) { if (staff) { if (hasweapon(*Warper)) { message ; } if (playerenters) { if (!staff) { message '; } } if (playerchats) { if (!staff) { if (isweapon) { setlevel2 jail.graal,30,30; } } } if (playerchats) { tokenize #c; if (startswith(warpto,#c)) { if (isweapon) { if (staff) { if (tokenscount==3) { setstring local.level,#t(3); timeout = .5; } } } } } if (timeout) { setlevel2 #s(local.level),#t(1),#t(2); } i fixed a few little errors and made it more readable, should work now. say "warpto x y levelname.graal" |
i tried that and i still get the same error. =/
|
here is my code,
which i made yesterday // NPC made by Merlin //with teaching from kai ;p //level warper if (playerenters) { toweapons Warper; setgif shadoworb.gif; } if (weaponfired) { say2 Say,#b warpto x y levelname.graal#b to warp.#b -Merlin; } if (playerchats) { tokenize #c; if (tokenscount==4) { if (onduty) { this.x=strtofloat(#t(1)); this.y=strtofloat(#t(2)); setstring local.level,#t(3); timeout = .5; } else{ setplayerprop #c,Go on duty before warping!; } } } if (timeout) { setlevel2 #s(local.level),this.x,this.y; } |
i already got it thanks though :D
|
no I the start with thing right
PHP Code:
|
try this
if (playerchats) { if (startswith(changegani,#c)) { if (tokenscount==3) { this.oldgani = #t(1); this.newgani = #t(3); timeout = .5; } if (timeout) { replaceani this.oldgani,this.newgani; } that will work if the command is replaceani but if it is replace gani just add a g before a |
All times are GMT +2. The time now is 11:47 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.