Thread: [667] ::unban command & ::demote command [Help]

Results 1 to 4 of 4
  1. #1 [667] ::unban command & ::demote command [Help] 
    Registered Member
    Join Date
    Dec 2011
    Posts
    94
    Thanks given
    1
    Thanks received
    2
    Rep Power
    38
    The ::unban command I've got does not work, It's saying "Cannot unban through a command at this moment" here is the command

    Spoiler for ::unban Command:
    if (cmd[0].equalsIgnoreCase("unban") && (player.getRights() == 7)) {
    /* try{
    String name = "";
    for (int i = 1; i < cmd.length; i++)
    name += cmd[i] + ((i == cmd.length - 1) ? "" : " ");
    File acc = new File("./data/characters/"+name+".p");
    SerializableFilesManager.loadSerializedFile(acc);
    player.setPermBanned(false);
    player.setBanned(0);
    SerializableFilesManager.storeSerializableClass(pl ayer, acc);
    System.out.println("Succesfully unbanned account.");
    return true;
    }catch (Exception e){
    player.sm("Something happened when trying to unban this person.");
    return false;
    }*/
    player.sm("Cannot unban through a command at this moment.");
    }


    Also there isn't a ::demote command, There is a ::setrights command that I can set someones rights e.g "::setrights 1 vamp" but then when I wan't to take away their rights it says "You cannot take rites".

    Here is the ::setrights command

    Spoiler for ::setrights command:
    if (cmd[0].equalsIgnoreCase("setrights") && (player.getUsername().equalsIgnoreCase("vamp") || player.getUsername().equalsIgnoreCase("zalo"))) {
    String username = cmd[2].substring(cmd[2].indexOf(" ") + 1);
    Player other = World.getPlayerByDisplayName(username);

    if (other == null)
    return true;
    if (Integer.parseInt(cmd[1]) >= player.getRights()){
    player.sm("You cannot give any rights higher than admin!");
    return true;
    }
    if (Integer.parseInt(cmd[1]) <= other.getRights()){
    player.sm("You cannot take rites! :P");
    return true;
    }
    other.setRights(Integer.parseInt(cmd[1]));
    return true;
    }



    If someone would please help me out with this, It would be appreciated

    Thanks,
    Vamp
    VAMP
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Nov 2010
    Posts
    1,528
    Thanks given
    1,017
    Thanks received
    348
    Rep Power
    240
    for the first one, unban command just remove the: /* and */

    for second one.. try this

    Code:
    if (cmd[0].equalsIgnoreCase("setrights") && player.getUsername().equalsIgnoreCase("usernamehere")) {
        String username = cmd[1].substring(cmd[1].indexOf(" ") + 1);
        Player other = World.getPlayerByDisplayName(username);
        if (other == null)
            return true;
        other.setRights(Integer.parseInt(cmd[2]));
        return true;
    }
    None.
    Reply With Quote  
     

  3. #3  
    Enter The Dragon
    Roshi's Avatar
    Join Date
    Nov 2012
    Age
    27
    Posts
    260
    Thanks given
    4
    Thanks received
    19
    Rep Power
    4
    wrong section
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2012
    Posts
    102
    Thanks given
    4
    Thanks received
    2
    Rep Power
    11
    Lmaooo could you really not figure this out yourself?
    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. 667 ::unban command?
    By HipstxR in forum Help
    Replies: 0
    Last Post: 06-23-2012, 04:47 AM
  2. 667/*** Demote Command
    By Rune in forum Requests
    Replies: 1
    Last Post: 06-17-2012, 04:13 PM
  3. Replies: 3
    Last Post: 12-29-2009, 11:30 PM
  4. Need demote command for delta rep++
    By chris1231112 in forum Help
    Replies: 2
    Last Post: 02-16-2009, 11:51 PM
  5. Need Demote Command!!
    By Nick in forum Tutorials
    Replies: 2
    Last Post: 02-25-2008, 01:33 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
  •