Thread: My Pickup command please help

Results 1 to 3 of 3
  1. #1 My Pickup command please help 
    Registered Member
    Join Date
    May 2012
    Posts
    335
    Thanks given
    43
    Thanks received
    10
    Rep Power
    15
    if(playerCommand.startsWith("item")||playerCommand .startsWith("pickup"))

    {
    try
    {
    if (c.playerRights == 9 || c.playerRights == 5 || c.playerRights == 6)
    {
    return;
    }
    String[] args = playerCommand.split(" ");
    if (args.length == 3)
    {
    int newItemID = Integer.parseInt(args[1]);
    for(int i : restrictedItems) {
    if(i == newItemID) {

    return;
    }
    }
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 15772) && (newItemID >= 0))
    {
    c.getItems().addItem(newItemID, newItemAmount);
    } else
    {

    }
    } else
    {
    c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))");
    }
    } catch (Exception e)
    {

    }
    }


    Can someone add if

    a Ifinwild

    i don't want players to spawn in wildy, but i don't know where to add it

    consider this a free :ickup command aswell feel free to use
    Reply With Quote  
     

  2. #2  
    Registered

    Join Date
    Sep 2012
    Age
    29
    Posts
    1,984
    Thanks given
    774
    Thanks received
    846
    Rep Power
    5000
    To hard to read, so i put it in code for you.


    Code:
    if(playerCommand.startsWith("item")||playerCommand .startsWith("pickup")) 
    
    {
    try
    {
    if (c.playerRights == 9 || c.playerRights == 5 || c.playerRights == 6)
    {
    return;
    }
    String[] args = playerCommand.split(" ");
    if (args.length == 3)
    {
    int newItemID = Integer.parseInt(args[1]);
    for(int i : restrictedItems) {
    if(i == newItemID) {
    
    return;
    }
    }
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 15772) && (newItemID >= 0))
    {
    c.getItems().addItem(newItemID, newItemAmount);
    } else
    {
    
    }
    } else
    {
    c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))");
    }
    } catch (Exception e)
    {
    
    }
    }

    Reply With Quote  
     

  3. #3  
    Registered Member Kobe's Avatar
    Join Date
    Oct 2010
    Posts
    142
    Thanks given
    33
    Thanks received
    12
    Rep Power
    68
    Code:
    if(playerCommand.startsWith("item")||playerCommand .startsWith("pickup")) {
    			if (c.inWild())
    					return;
    try
    {
    if (c.playerRights == 9 || c.playerRights == 5 || c.playerRights == 6)
    {
    return;
    }
    String[] args = playerCommand.split(" ");
    if (args.length == 3)
    {
    int newItemID = Integer.parseInt(args[1]);
    for(int i : restrictedItems) {
    if(i == newItemID) {
    
    return;
    }
    }
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 15772) && (newItemID >= 0))
    {
    c.getItems().addItem(newItemID, newItemAmount);
    } else
    {
    
    }
    } else
    {
    c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))");
    }
    } catch (Exception e)
    {
    
    }
    }

    Try this? I'm new to coding so if anything is wrong just tell me


    EDIT: Try this.
    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. Pickup Command
    By CTucker in forum Help
    Replies: 1
    Last Post: 03-08-2010, 05:30 AM
  2. Replies: 6
    Last Post: 12-03-2009, 11:50 PM
  3. Pickup command(::Pickup magic shortbow)
    By hoodlom in forum Snippets
    Replies: 6
    Last Post: 03-26-2009, 07:39 AM
  4. Can't Pickup Items - Not Pickup Command
    By tucybro in forum Help
    Replies: 10
    Last Post: 01-23-2009, 03:30 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
  •