You should use something like this:
Quote:
Originally Posted by Twinny
This is what I did for Classic iPhone stealth (removed some other parts to provide this),
Weapon: -Staff/Stealth
PHP Code:
//#CLIENTSIDE function onCreated() { player.attr[22] = "unstealth.gani"; }
function ChatBar.onAction() { if (ChatBar.text == "/stealth") { toggleStealth(); ChatBar.text = ""; } }
function toggleStealth() { this.stealth = !this.stealth; if (this.stealth) player.attr[22] = "stealth.gani"; else player.attr[22] = "unstealth.gani"; }
in the gani,
PHP Code:
function onPlayerEnters() { if (clientr.isStaff) player.alpha = 0.4; else player.alpha = 0; }
So, all staff can see the stealthed person at half alpha while no-one else can see them.
|
also, something like this
Quote:
Originally Posted by boolean
PHP Code:
function onPlayerChats() { if(player.chat.starts("/add")) triggerServer("gui", this.name, "add", NULL, player.chat.tokenize()[1]); if(player.chat.starts("/remove")) triggerServer("gui", this.name, "remove", NULL, player.chat.tokenize()[1]); if(player.chat == "/exceptions") { triggerServer("gui", this.name, "view"); player.chat = ""; } if(player.chat.starts("/add") || player.chat.starts("/remove")) player.chat = ""; }
|
should be changed to something like this
PHP Code:
function onPlayerChats() {
temp.toks = player.chat.tokenize();
if (player.chat.starts("/add")) {
triggerServer("gui", this.name, "add", NULL, temp.toks[1]);
player.chat = " ";
}
else if (player.chat.starts("/remove")) {
triggerServer("gui", this.name, "remove", NULL, temp.toks[1]);
player.chat = " ";
}
else if (player.chat == "/exceptions") {
triggerServer("gui", this.name, "view");
player.chat = " ";
}
}
styling your codes would also be something you should try out