Thread: Pi "item" command Please help(:

Results 1 to 4 of 4
  1. #1 Pi "item" command Please help(: 
    Registered Member
    Join Date
    Feb 2012
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    [I]Alright so I hit a little issue with a server that I download, on the commands.java There's a command "Item" for pickup crap anyways heres the code

    Code:
    					}
    					
    			if (playerCommand.startsWith("item")) {
    				try {
    					String[] args = playerCommand.split(" ");
    					if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = 
    
    Integer.parseInt(args[2]);
    						if ((newItemID <= 20500) && (newItemID >= 
    
    0)) {
    							c.getItems().addItem(newItemID, 
    
    newItemAmount);		
    						} else {
    							c.sendMessage("That item ID does not 
    
    exist.");
    						}
    					} else {
    						c.sendMessage("Wrong usage: 
    
    (Ex:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    				} // HERE?
    			} // HERE?
    Where exactly do I controll what rank levels can use the command?

    I have other commands like

    Code:
    if (playerCommand.startsWith("ipban")) {
    				try {
    					String playerToBan = playerCommand.substring(6);
    					for(int i = 0; i < Config.MAX_PLAYERS; i++) {
    						if(Server.playerHandler.players[i] != null) 
    
    {
    							
    
    if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
    								
    
    Connection.addIpToBanList(Server.playerHandler.players[i].connectedFrom);
    								
    
    Connection.addIpToFile(Server.playerHandler.players[i].connectedFrom);
    								c.sendMessage("You have IP 
    
    banned the user: "+Server.playerHandler.players[i].playerName+" with the host: 
    
    "+Server.playerHandler.players[i].connectedFrom);
    						Client c2 = 
    
    (Client)Server.playerHandler.players[i];
    								
    
    Server.playerHandler.players.disconnected = true;
    								c2.sendMessage(" " 
    
    +c2.playerName+ " Got IpBanned By " + c.playerName+ ".");
    							} 
    						}
    					}
    				} catch(Exception e) {
    					c.sendMessage("Player Must Be Offline.");
    				}
    			}
    


    And a bunch more that are like that any clue where I can edit the rank level that can use it?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2012
    Posts
    408
    Thanks given
    15
    Thanks received
    2
    Rep Power
    20
    change this :
    if (playerCommand.startsWith("item")

    with :

    if (playerCommand.startsWith("item") && c.playerRights >= 2) {



    That means admin+ can use ::item command if you want owners only then change 2 to 3
    ,,
    right 1=mod, 2=admin 3=owner 4=don/hidden admin = 0 normal player add that to commands u want
    my vouches are on my profile.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2012
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by tlsown View Post
    change this :
    if (playerCommand.startsWith("item")

    with :

    if (playerCommand.startsWith("item") && c.playerRights >= 2) {



    That means admin+ can use ::item command if you want owners only then change 2 to 3
    ,,
    right 1=mod, 2=admin 3=owner 4=don/hidden admin = 0 normal player add that to commands u want
    Thanks budd
    Reply With Quote  
     

  4. #4  
    Super Donator

    Batukka's Avatar
    Join Date
    Oct 2011
    Posts
    2,433
    Thanks given
    86
    Thanks received
    342
    Rep Power
    496
    Quote Originally Posted by iibandosii View Post
    I tried that gives me errors when compile
    show the errors?
    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. Replies: 4
    Last Post: 01-19-2012, 05:19 PM
  2. "hed","head","headicon" command like ::emote Rep++
    By «I Gf I» ©£ in forum Help
    Replies: 12
    Last Post: 10-06-2009, 05:30 AM
  3. Replies: 23
    Last Post: 09-10-2009, 03:29 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
  •