Thread: problem with givemod, giveadmin and demote command

Results 1 to 4 of 4
  1. #1 problem with givemod, giveadmin and demote command 
    Registered Member finalpk's Avatar
    Join Date
    Dec 2009
    Posts
    60
    Thanks
    0
    Thanked 2 Times in 1 Post
    Rep Power
    8
    hi i wanna add the givemod, giveadmin, demote commands to my 562 rs2hd server.

    this are my commands:

    if(cmd[0].equals("demote")) {
    Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
    if (other != null) {
    other.rights = 0;
    }
    }

    if(cmd[0].equals("givemod")) {
    player.getActionSender().sendMessage("test");
    Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
    if (other != null) {
    other.rights = 1;
    }
    }

    if(cmd[0].equals("giveadmin")) {
    Player other = World.getInstance().getPlayerList().get(World.getI nstance().getIdFromName(command.substring((command .indexOf(" ") + 1))));
    if (other != null) {
    other.rights = 2;
    }
    }
    but when i compile it i get this errors:
    [IMG][/IMG]

    please help me.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Sep 2008
    Posts
    83
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Rep Power
    1
    Code:
    private int rights = 0;
    Reply With Quote  
     

  3. #3  
    Registered Member finalpk's Avatar
    Join Date
    Dec 2009
    Posts
    60
    Thanks
    0
    Thanked 2 Times in 1 Post
    Rep Power
    8
    i still get errors
    Reply With Quote  
     

  4. #4  
    Registered Member AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,288
    Thanks
    38
    Thanked 47 Times in 44 Posts
    Rep Power
    59
    Isn't it something like other.getRights()? If not then just change private int rights = 0; to public int rights = 0;


    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •