Nothing wrong with it that I can see, except that you'll want to do the checks serverside.
PHP Code:
function onActionServerSide(tokens){
if (tokens[0] == "/kill") {
if (player.clientr.stafflvl > 1) {
temp.pl = findPlayerByCommunityName(tokens[1]);
temp.pl.hearts = 0;
temp.pl.chat = player.account SPC "killed you!";
player.chat = "You killed" SPC temp.pl SPC "!";
} else {
player.chat = "Not authorized!";
}
}
}
//#CLIENTSIDE
function onPlayerChats() {
if(tokens[0] == "/kill") {
temp.tokens = player.chat.tokenize();
triggerServer("gui", this.name, tokens);
}
}
Also, there's no reason to do
(player.clientr.stafflvl)—just
player.clientr.stafflvl works fine.
The reason I inserted another
if statement was so you could use the
else clause properly. If you'd used
&& instead, then the
else would also apply if the command wasn't "/kill".
Also, be sure to work on your styling. Two spaces is an indent.