zeck Owner
Posts : 27 Reputation : 3 Join date : 2010-01-17 Age : 33 Location : Florida
| Subject: Caelum Base how to make ::item command for mods only Wed Apr 28, 2010 8:52 pm | |
| OK this is very simple but if you can't do a simple thing like changing the if(player.getRights() < 0) { and change the 0 to a 1 you are very lazy. If you can't do that just copy and paste my command. - Code:
-
} if(cmd[0].equals("::item")) { if(player.getRights() < 1) { player.getActionSender().sendMessage("This command is for Admins only."); return; } if (!player.SafeZone()) { player.sm("You cant spawn items at wilderness/BountyHunter."); return; }
int[] corpbeast = { 13740, 13742, 13741, 13743}; int[] tormenteddemon = {14479, 14484, 14485, 14480}; int[] slay = {4151, 11732}; int[] godwars = {11694, 11695, 11696, 11697, 11698, 11699, 11700, 11701, 13450, 13451, 13452, 13453, 11724, 11725, 11726, 11727, 11728, 11729, 13458, 13459, 13460, 11718, 11719, 11720, 11721, 11722, 11723, 12670, 12671, 13455, 13456, 13457, 11702, 11703, 11705, 11707, 11708, 11709, 11704, 11706, 11708, 11713, 11711, 11715, 11712, 11686, 11687, 11689, 11691, 11710, 11690, 11688, 11714, 11692, 11693}; int PvPItems[] = {8055,8056,8057,11181,11182, 13905, 13902, 13896, 13890, 13884, 13887,13893,13899 ,13887}; if(cmd.length == 2) { int item = Integer.valueOf(cmd[1]); if (item == 995) { player.sm("You can't spawn coins."); return;}
for (int i = 0; i < corpbeast.length; i++) { if (item == corpbeast[i]) { player.sm("You can't spawn this item. Go kill Corporeal Beast for them."); return;} } for (int i = 0; i < godwars.length; i++) { if (item == godwars[i]) { player.sm("You can't spawn Godswords, you have to go ::gw and kill for the drop."); return;} } for (int i = 0; i < slay.length; i++) { if (item == slay[i]) { player.sm("You can't spawn these item. Go kill them at ::slayertower for them."); return;} } for (int i = 0; i < tormenteddemon.length; i++) { if (item == tormenteddemon[i]) { player.sm("You can't spawn these item. Go kill Tormented demons at Edgeville dungeon for them."); return;} } for (int i = 0; i < PvPItems.length; i++) { if (item == PvPItems[i]) { player.sm("You can't spawn these item. They rare pvp drops."); return;} } int amount = 1; player.getInventory().addItem(item, amount); } if(cmd.length == 3) { int item = Integer.valueOf(cmd[1]); if (item == 995) { player.sm("You can't spawn coins."); return;}
for (int i = 0; i < corpbeast.length; i++) { if (item == corpbeast[i]) { player.sm("You can't spawn these item. Go kill Corporeal Beast for them."); return;} } for (int i = 0; i < godwars.length; i++) { if (item == godwars[i]) { player.sm("You can't spawn these item. Go kill Godwars bosses for them."); return;} } for (int i = 0; i < tormenteddemon.length; i++) { if (item == tormenteddemon[i]) { player.sm("You can't spawn these item. Go kill Tormented demons at Edgeville dungeon for them."); return;} } for (int i = 0; i < PvPItems.length; i++) { if (item == PvPItems[i]) { player.sm("You can't spawn these item. Theyre rare pvp drops."); return;} } int amount = Integer.valueOf(cmd[2]); player.getInventory().addItem(item, amount); }
And thats it. Replace your ::item command with mines and only mods can spawn items. | |
|