Thread: Need help editing ::pickup command Synergy-Pkz Source

Results 1 to 2 of 2
  1. #1 Need help editing ::pickup command Synergy-Pkz Source 
    Registered Member
    Join Date
    Apr 2009
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Basicly I can't figure out how to make it for all players... I haven't seen server files setup like this ever.. Any help is appreciated, Each command has it's own .java file here is the ENTIRE Pickup.java File.
    package com.rs2hd.packethandler.commands;

    import com.rs2hd.model.Player;
    import com.rs2hd.content.PlayerDrops;

    /**
    *
    * Item spawn command.
    * @author Luke132
    */
    public class Pickup implements Command {

    @Override
    public void execute(Player player, String command) {
    String cmd[] = command.split(" ");
    try {
    if(!player.SafeZone()) {

    player.sm("You must be in a Safe Zone to use this command.");
    return;
    }
    for (int i = 0; i < PlayerDrops.PvPItems.length; i++) {
    if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPItems[i] && player.getRights() < 2) {
    player.sm("You cannot pickup an item that has to be gotten from pking.");
    return;
    }
    }
    for (int i = 0; i < PlayerDrops.PvPANCIENT.length; i++) {
    if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPANCIENT[i] && player.getRights() < 2) {
    player.sm("You cannot pickup an item that has to be gotten from pking.");
    return;
    }
    }
    for (int i = 0; i < PlayerDrops.Rings.length; i++) {
    if (Integer.valueOf(cmd[1]) == PlayerDrops.Rings[i] && player.getRights() < 2) {
    player.sm("You cannot pickup an item that has to be gotten from pking.");
    return;
    }
    }
    //if (Integer.valueOf(cmd[1]) == 14484 || Integer.valueOf(cmd[1]) == 7946 || Integer.valueOf(cmd[1]) == 391 && player.getRights() < 2) {
    //player.sm("You cannot pickup Dragon Claws, go pk for them");
    //return;
    //}
    if (Integer.valueOf(cmd[1]) == 995 && player.getRights() < 1) {
    player.sm("You cannot pickup coins, it has been disabled until we get a shop");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 4178 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 11284 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 10566 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 4675 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 13867 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 10637 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1038 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1040 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1042 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1044 && player.getRights() < 1) {
    player.sm("you cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1046 && player.getRights() < 1) {
    player.sm("You cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1048 && player.getRights() < 1) {
    player.sm("You cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 1050 && player.getRights() < 1) {
    player.sm("You cannot pickup this item.");
    return;
    }
    if (Integer.valueOf(cmd[1]) == 2422 && player.getRights() < 1) {
    player.sm("You cannot pickup this item.");
    return;
    }
    player.getInventory().addItem(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]));
    } catch (Exception e) {
    player.getActionSender().sendMessage("Invaild Characters, please try again.");
    }
    }

    @Override
    public int getRights() {
    return 2;
    }

    }

    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Code:
    package com.rs2hd.packethandler.commands;
    
    import com.rs2hd.model.Player;
    import com.rs2hd.content.PlayerDrops;
    
    public class Pickup implements Command {
    
    	private static final int[] UNPICKUPABLES = { 
    			4178,11284,10566,4675,13867,10637,1038,
    			1040,1042,1044,1046,1048,1050,2442
    	};
    
    	@Override
    	public void execute(Player p, String command) {
    		String cmd[] = command.split(" ");
    		try {
    			if(!p.SafeZone()) {
    				p.sm("You must be in a Safe Zone to use this command.");
    				return;
    			}
    			for (int i = 0; i < PlayerDrops.PvPItems.length; i++) {
    				if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPItems[i] && p.getRights() < 2) {
    					p.sm("You cannot pickup an item that has to be gotten from pking.");
    					return;
    				}
    			}
    			for (int i = 0; i < PlayerDrops.PvPANCIENT.length; i++) {
    				if (Integer.valueOf(cmd[1]) == PlayerDrops.PvPANCIENT[i] && p.getRights() < 2) {
    					p.sm("You cannot pickup an item that has to be gotten from pking.");
    					return;
    				}
    			}
    			for (int i = 0; i < PlayerDrops.Rings.length; i++) {
    				if (Integer.valueOf(cmd[1]) == PlayerDrops.Rings[i] && p.getRights() < 2) {
    					p.sm("You cannot pickup an item that has to be gotten from pking.");
    					return;
    				}
    			}
    			if (Integer.valueOf(cmd[1]) == 995 && p.getRights() > 1) {
    				p.sm("You cannot pickup coins, it has been disabled until we get a shop");
    				return;
    			}
    			for (int item : UNPICKUPABLES) {
    				if (Integer.valueOf(cmd[1]) == item && p.getRights() < 1) {
    					p.sm("you cannot pickup this item.");
    					return;
    				}
    			}
    			p.getInventory().addItem(Integer.valueOf(cmd[1]), Integer.valueOf(cmd[2]));
    		} catch (Exception e) {
    			p.getActionSender().sendMessage("You mest up try ::pickup 392 1");
    		}
    	}
    
    }
    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

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