Thread: Some questions
View Single Post
  #8  
Old 05-01-2011, 10:35 PM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
Im trying to do a script where if someone with a staff level 2 or higher says "/kill <account>" it does so.

The script worked before I added the staff level requirement. Also can you show me where i would add an else statement for those who aren't level 2 or higher? I am trying to make it say "Not Allowed". At one point it was making my text "Not Allowed" no matter what i said unless i said "/kill <account>" so i think i was close.

PHP Code:
function onActionServerSide(tokens){
    if (
tokens[0] == "/kill") {
        
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 "!";
    }
}

//#CLIENTSIDE
function onPlayerChats() {
    if(
tokens[0] == "/kill" && (player.clientr.stafflvl) > 1) {
        
temp.tokens player.chat.tokenize();
        
triggerServer("gui"this.nametokens);
    }

__________________
Reply With Quote