- Joined
- Mar 6, 2012
- Messages
- 1,503
- Reaction score
- 213
Add this in your commands
Add this in MapleCharacter
!playeritem ign itemid amount
!playeruse/etc/setup/cash/equip ign itemid amount
PHP:
} else if (splitted[0].equalsIgnoreCase("playeritem")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerGain(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
player.dropMessage("You have given " + victim.getName() + " the item " + splitted[2] + "");
victim.dropMessage("You have gained an " + splitted[2] + " from " + player.getName() + "");
} else if (splitted[0].equalsIgnoreCase("playerequip")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerEquip(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playeruse")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerUse(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playercash")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerCash(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playeretc")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerEtc(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
} else if (splitted[0].equalsIgnoreCase("playersetup")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
victim.playerSetup(Integer.parseInt(splitted[2]),Integer.parseInt(splitted[3]));
victim.dropMessage("" + player.getName() + " has taken " + splitted[3] + " of " + splitted[2] + " from you.");
Add this in MapleCharacter
PHP:
public void playerGain(int item, int amount) {
if (MapleInventoryManipulator.addById(client, item, (short) amount, null, -1)) {
} else {
try {
client.getPlayer().getClient().getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(1, " " + client.getPlayer().getName() + " has not recieved their item " + item + "").getBytes());
} catch (RemoteException ex) {
}
}
}
public void playerEquip(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.EQUIP, item, amount, true, true);
}
public void playerCash(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.CASH, item, amount, true, true);
}
public void playerUse(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.USE, item, amount, true, true);
}
public void playerEtc(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.ETC, item, amount, true, true);
}
public void playerSetup(int item, int amount) {
MapleInventoryManipulator.removeById(client, MapleInventoryType.SETUP, item, amount, true, true);
}
!playeritem ign itemid amount
!playeruse/etc/setup/cash/equip ign itemid amount
Last edited:

