Thread: Pickup Command

Results 1 to 9 of 9
  1. #1 Pickup Command 
    Banned
    Join Date
    May 2010
    Posts
    107
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Code:
    if (command.startsWith("pickup") && playerRights > 0) {
    		        String[] args = command.split(" ");
    	         if(args.length == 3) {
    			int newItemID = Integer.parseInt(args[1]);
    			int newItemAmount = Integer.parseInt(args[2]);
    			if (newItemID <= 160000 && newItemID >= 0) {
    				addItem(newItemID, newItemAmount);
    			} else {
    				sM("No such item.");
    			}
    		} else {
    			sM("Oops! Use as ::pickup 4151 1");
    		}
    	    }
    }
    I want the command to be for normal players as well, Because i am making it a pickup server.

    I need the PlayerRights. I have tried 0 and it doesn't work.
     

  2. #2  
    Extreme Donator


    Join Date
    Nov 2009
    Posts
    1,421
    Thanks given
    559
    Thanks received
    266
    Rep Power
    236
    Just remove the player rights, this bit >>
    Code:
    && playerRights > 0) {
     

  3. #3  
    Fake Love


    Join Date
    Jun 2008
    Age
    28
    Posts
    439
    Thanks given
    224
    Thanks received
    312
    Rep Power
    4385
    if (command.startsWith("pickup") {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if (newItemID <= 160000 && newItemID >= 0) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("No such item.");
    }
    } else {
    sM("Oops! Use as :ickup 4151 1");
    }
    }
    }
     

  4. #4  
    Donator

    Ecstasy's Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    5,031
    Thanks given
    324
    Thanks received
    596
    Rep Power
    843
    Quote Originally Posted by Alcazar View Post
    if (command.startsWith("pickup") {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if (newItemID <= 160000 && newItemID >= 0) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("No such item.");
    }
    } else {
    sM("Oops! Use as :ickup 4151 1");
    }
    }
    }
    that'll give 100 errors.

     

  5. #5  
    Web Developer
    Connor's Avatar
    Join Date
    Jul 2010
    Posts
    203
    Thanks given
    21
    Thanks received
    2
    Rep Power
    47
    Code:
    if (command.startsWith("pickup") && playerRights <= 3) {
    		        String[] args = command.split(" ");
    	         if(args.length == 3) {
    			int newItemID = Integer.parseInt(args[1]);
    			int newItemAmount = Integer.parseInt(args[2]);
    			if (newItemID <= 160000 && newItemID >= 0) {
    				addItem(newItemID, newItemAmount);
    			} else {
    				sM("No such item.");
    			}
    		} else {
    			sM("Oops! Use as ::pickup 4151 1");
    		}
    	    }
    }
    Thats the right one all the others are bullshit, the '<= 3' means that Owners and Under can use it... Eg Owner, admin, mod, player etc/

    Thanks

    Mr Silent

    Kind Regards,
    Connor
     

  6. #6  
    Banned
    Join Date
    May 2010
    Posts
    107
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    if (command.startsWith("pickup")) {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if (newItemID <= 160000 && newItemID >= 0) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("No such item.");
    }
    } else {
    sM("Oops! Use as :ickup 4151 1");
    }
    }
    }
    Ive done it.
     

  7. #7  
    Fake Love


    Join Date
    Jun 2008
    Age
    28
    Posts
    439
    Thanks given
    224
    Thanks received
    312
    Rep Power
    4385
    Ohh yh i missed a bracket Oh well.

    Anyway, Are you sure your ready for a RSPS if you cant even do that? Or are you a leecher?
     

  8. #8  
    Registered Member
    Join Date
    Jun 2010
    Posts
    14
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by Alcazar View Post
    Ohh yh i missed a bracket Oh well.

    Anyway, Are you sure your ready for a RSPS if you cant even do that? Or are you a leecher?
    Don't give him shit, you were there one day yourself.

    Welcome to the Rsps community. (assuming your new sorry )
     

  9. #9  
    Registered Member
    Join Date
    Feb 2011
    Posts
    2
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Change sM to sendMessage.
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •