Cool. Seems like it might be easier to just do something like:
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
player.chat == "stealth" ? onTimeout() : (player.chat == "nostealth" ? setTimer(0) : NULL);
}
function onTimeout() {
hideplayer(0.1);
setTimer(0.1);
}
You can say "stealth" or "nostealth" to toggle it.