Quote:
Originally Posted by Kyranki
Erm, Chris then explain to me why it's not working at all here. o.o
PHP Code:
function onPlayerChats() { temp.toks = player.chat.tokenize(); temp.com = player.chat.substring(1, temp.toks[0].length()); echo(temp.toks); echo(temp.com); switch (temp.com) { case "global": echo("boo"); break; default: echo("bark"); break; } }
Is resulting to the default.
|
Why wouldn't you just do:
PHP Code:
temp.com = temp.toks[0].substring(1);
switch (temp.com) {
case "global":
echo("hi");
break;
}
Edit: Ah, see you figured it out before I posted it.
