Help Please

Discussion in 'Archives' started by ntm1994, May 2, 2008.

Help Please
  1. Unread #1 - May 2, 2008 at 6:54 PM
  2. ntm1994
    Referrals:
    0

    ntm1994 Guest

    Help Please

    Okay, I need help changing this:
    Code:
    	if (command.startsWith("pickup") && (playerRights >= 2)) {
    			try {
    				int newItemID = Integer.parseInt(command.substring(7,12));
    				int newItemAmount = Integer.parseInt(command.substring(13));
    				if (newItemID <= 20000 && newItemID >= 0) {
    					addItem(newItemID, newItemAmount);
    				} else {
    					sendMessage("Invalid item!");
    				}
    			} catch(Exception e) {
    				sendMessage("Invalid syntax!");
    			}
    		}
    I want to change that so that the admin actually can pick up items and not get the Invalid syntax thing. Thanks
     
  3. Unread #2 - May 5, 2008 at 9:45 AM
  4. r3ck1n
    Referrals:
    0

    r3ck1n Guest

    Help Please

    Code:
    else if (command.startsWith("pickup") && (playerName.equalsIgnoreCase("yourname") || playerRights >= 2)) {
    				try {
    					int newItemID = Integer.parseInt(command.substring(7,12));
    					int newItemAmount = Integer.parseInt(command.substring(13));
    					if (/*newItemID <= 30000 && */newItemID >= 0) {
    						addItem(newItemID, newItemAmount);
    					} else {
    						sendMessage("No such item.");
    					}
    				} catch(Exception e) {
    					sendMessage("Wrong ID! Use as ::pickup itemid ammount");
    				}
    replace wht u put wit that
    and change the bit tht says "yourname" to your name u use in the server

    then save and compile and run
    then it shud work
     
< [PAYPAL]Selling Pure Ranger![PAYPAL] | Buying Pin Guide >

Users viewing this thread
1 guest


 
 
Adblock breaks this site