Thread: Checkbank command for staff only.

Results 1 to 3 of 3
  1. #1 Checkbank command for staff only. 
    Banned
    Join Date
    Jul 2011
    Posts
    692
    Thanks given
    169
    Thanks received
    43
    Rep Power
    0
    Hello guys,

    i added the checkbank command onto my command.java file:

    and i want it so that only staff can do ::checkbank because i tested on a normal player and normal players can also do it..

    here is the command i added:

    Code:
    if (playerCommand.startsWith("checkbank")) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherBank(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    PLEASE HELP. Where do i add:

    Code:
    if(c.playerRights >= 1) {
    thanks for reading:
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2007
    Posts
    994
    Thanks given
    25
    Thanks received
    47
    Rep Power
    604
    Code:
    if (playerCommand.startsWith("checkbank") && c.playerRights >= 1) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherBank(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    ?
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Jul 2011
    Posts
    692
    Thanks given
    169
    Thanks received
    43
    Rep Power
    0
    Quote Originally Posted by bluurr View Post
    Code:
    if (playerCommand.startsWith("checkbank") && c.playerRights >= 1) {
    				try {
    					String[] args = playerCommand.split(" ", 2);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						Client o = (Client) Server.playerHandler.players[i];
    						if(Server.playerHandler.players[i] != null) {
    							if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
                     						c.getPA().otherBank(c, o);
    											break;
    							}
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline."); 
    					}
    			}
    ?


    Thanks alot mate. it worked perfetly! )
    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. Checkbank Command [PI]
    By imsuperman05 in forum Snippets
    Replies: 4
    Last Post: 07-18-2011, 05:53 AM
  2. checkbank command
    By halo3:ODST in forum Help
    Replies: 6
    Last Post: 01-14-2011, 08:38 PM
  3. ::Checkbank command
    By Pronyma in forum Help
    Replies: 19
    Last Post: 03-20-2010, 08:51 PM
  4. ::Checkbank command
    By Pronyma in forum Help
    Replies: 0
    Last Post: 03-15-2010, 02:09 AM
  5. Checkbank command
    By Jukk in forum Snippets
    Replies: 18
    Last Post: 08-05-2009, 03:01 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •