Thread: Problems with giving admin/mod through commands

Results 1 to 3 of 3
  1. #1 Problems with giving admin/mod through commands 
    Banned
    Join Date
    Dec 2010
    Posts
    44
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    So these are my commands for giveadmin and givemod:

    Code:
    case "admin":
    				if (player.getUsername().equalsIgnoreCase("homework")) {
    					player.setRights(2);
    					player.getAppearence().generateAppearenceData();
    				}
    				return true; 
    
    			case "mod":
    				if (player.getUsername().equalsIgnoreCase("homework")) {
    					player.setRights(1);
    					player.getAppearence().generateAppearenceData();
    				}

    ----

    And for some reason, when I type ;;admin username

    it doesn't make them admin.
    I have owner rights.

    And I have tried everything. Please help.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by rigsy View Post
    So these are my commands for giveadmin and givemod:

    Code:
    case "admin":
    				if (player.getUsername().equalsIgnoreCase("homework")) {
    					player.setRights(2);
    					player.getAppearence().generateAppearenceData();
    				}
    				return true; 
    
    			case "mod":
    				if (player.getUsername().equalsIgnoreCase("homework")) {
    					player.setRights(1);
    					player.getAppearence().generateAppearenceData();
    				}

    ----

    And for some reason, when I type ;;admin username

    it doesn't make them admin.
    I have owner rights.

    And I have tried everything. Please help.

    I recommend you actually read the command lol.
    It has nothing to do with giving another player the rights..
    It gives you it..
    Reply With Quote  
     

  3. #3  
    Donator
    Will_'s Avatar
    Join Date
    Oct 2013
    Age
    26
    Posts
    153
    Thanks given
    14
    Thanks received
    8
    Rep Power
    11
    Code:
    if (cmd[0].equalsIgnoreCase("giveadmin") && (player.getUsername().equalsIgnoreCase("homework"))) {
    			String username = cmd[1].substring(cmd[1].indexOf(" ") + 1);
    			Player other = World.getPlayerByDisplayName(username);
    			try {
    				if (other == null)
    					return true;
    				for (Player players : World.getPlayers()) {
    				if (players == null)
    					continue;
    					players.getPackets().sendGameMessage(other.getDisplayName() + " just got promoted to Admin!");
    			    }
    				other.setRights(Settings.IS_ADMIN);
    				//World.removePlayer(other);
    			} catch (Exception e){
    				player.getPackets().sendGameMessage("Couldn't find player "+ username + ".");
    			}
    			return true;
    		}
    Try this. You can do the one for mod yourself now, for sure.
    Quote Originally Posted by Liam_ View Post
    I wouldn't be surprised if some of you just come here for content and not contribute to rune-server or the community in anyway.
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Give Admin/Mod command
    By Consigliere in forum Help
    Replies: 1
    Last Post: 06-12-2012, 07:07 PM
  2. 562 problem with item admin command
    By 12igon8 in forum Help
    Replies: 2
    Last Post: 10-25-2010, 03:06 AM
  3. Problems with ObjectInputStream and ObjectOutputStream through Socket
    By 'Connor in forum Application Development
    Replies: 5
    Last Post: 04-26-2010, 01:53 AM
  4. Replies: 3
    Last Post: 12-29-2009, 11:30 PM
  5. Replies: 4
    Last Post: 02-13-2009, 12:32 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •