PDA

View Full Version : [508]how to add a Item-giving command



gamerbug
July 9th, 2010, 20:30
say you wanted to give someone 10m cash.. this is the command you'd use


if (cmd[0].equals("givemoney") && p.rights >= 2) {
Player other = Engine.players[Engine.getIdFromName(command.substring((command.in dexOf(" ") + 1)))];
if (other != null) {
Engine.playerItems.addItem(other, 995, 10000000);
other.updateReq = true;
}
}
if you wanted it to say something you'd make the command this:


if (cmd[0].equals("givemoney") && p.rights >= 2) {
Player other = Engine.players[Engine.getIdFromName(command.substring((command.in dexOf(" ") + 1)))];
if (other != null) {
other.message("you were given 10m!");
p.message("you gave " + other + " 10m!");
Engine.playerItems.addItem(other, 995, 10000000);
other.updateReq = true;
}
}
hope I helped :)

Break
July 9th, 2010, 20:34
Nice, I think most got it, But oh well nice.

UnitedScape
July 9th, 2010, 20:51
nice will use