Thread: ::item command help

Results 1 to 3 of 3
  1. #1 ::item command help 
    Registered Member remote's Avatar
    Join Date
    Aug 2012
    Age
    29
    Posts
    42
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    How would you make it so the item command refreshes your inventory also, this way it shows up if you are doing something(such a searching the bank or buy items from the shop?)

    This is my current item command.
    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 <= 25000) && (newItemID >= 0)) {
    						c.getItems().addItem(newItemID, newItemAmount);
    						System.out.println("Spawned: " + newItemID + " by: "
    								+ c.playerName);
    					} else {
    						c.sendMessage("No such item.");
    					}
    				} else {
    					c.sendMessage("Use as ::item 995 200");
    				}
    			} catch (Exception e) {
    			}
    		}
    Reply With Quote  
     

  2. #2  
    Registered Member remote's Avatar
    Join Date
    Aug 2012
    Age
    29
    Posts
    42
    Thanks given
    3
    Thanks received
    0
    Rep Power
    11
    I would just like it to refresh my inventory, even if i am in a shop or the bank or something like that.
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    Chex's Avatar
    Join Date
    Jul 2010
    Age
    27
    Posts
    208
    Thanks given
    116
    Thanks received
    109
    Rep Power
    239
    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 <= 25000) && (newItemID >= 0)) {
    						c.getItems().addItem(newItemID, newItemAmount);
    						System.out.println("Spawned: " + newItemID + " by: "
    								+ c.playerName);
    					c.getItems.resetTempItems();
    					} else {
    						c.sendMessage("No such item.");
    					}
    				} else {
    					c.sendMessage("Use as ::item 995 200");
    				}
    			} catch (Exception e) {
    			}
    		}
    I added c.getItems.resetTempItems(); it just refreshed your inventory

    Attached image
    Attached image
    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. ::item command help (pi)
    By Boolean in forum Help
    Replies: 3
    Last Post: 04-16-2012, 03:51 PM
  2. [PI] Take item and give item command
    By Lotto230 in forum Help
    Replies: 10
    Last Post: 12-13-2011, 08:29 AM
  3. item command for everyone
    By pjc9119 in forum Tutorials
    Replies: 11
    Last Post: 09-06-2011, 08:04 AM
  4. [PI] Item Command
    By I'm A Jerk in forum Help
    Replies: 10
    Last Post: 04-24-2011, 03:31 AM
  5. ::item command Finding your item?
    By zx Bubbles zx in forum Requests
    Replies: 10
    Last Post: 11-10-2008, 06:41 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
  •