zeck Owner
Posts : 27 Reputation : 3 Join date : 2010-01-17 Age : 33 Location : Florida
| Subject: Caelum Base Making a command cost money Wed Apr 28, 2010 8:44 pm | |
| Ok here's another tutorial but this is for caelum base on how to make a command cost money. Ok so the original command should look like this. - Code:
-
if (cmd[0].equals("::pots")) { if (!player.SafeZone()) { player.sm("You cant spawn items at wilderness/BountyHunter"); return; } player.getInventory().addItem(139, 1); player.getInventory().addItem(2440, 1); player.getInventory().addItem(2436, 1); player.getInventory().addItem(2442, 1); }
What you want to do is modify it so you looks like this, Seeing the coding should already give you a hint of how to do it. - Code:
-
if (cmd[0].equals("::pots")) { if (!player.SafeZone()) { player.sm("You cant spawn items at wilderness/BountyHunter"); return; } if (!player.getInventory().contains(995, 150000)){ player.sm("<col=000000>You need 100k gold to use this command.<col=000000>"); return; } player.sm("<col=000000>You just bought some potions for 100k<col=000000>"); player.getInventory().deleteItem(995, 150000); player.getInventory().addItem(139, 1); player.getInventory().addItem(2440, 1); player.getInventory().addItem(2436, 1); player.getInventory().addItem(2442, 1); }
Ok and thats basically it. You can do that for anyitems for example dragon claws. Original Command - Code:
-
if (cmd[0].equals("::claws")) { if (!player.SafeZone()) { player.sm("You cant spawn items at wilderness/BountyHunter"); return; } player.getInventory().addItem(14484, 1); }
Here's the new and improved command. - Code:
-
if (cmd[0].equals("::claws")) { if (!player.SafeZone()) { player.sm("You cant spawn items at wilderness/BountyHunter"); return; } if (!player.getInventory().contains(995, 35000000)){ player.sm("<col=000000>You need 350m gold to use this command.<col=000000>"); return; } player.sm("<col=000000>You just bought a pair of dragon claws for 350m<col=000000>"); player.getInventory().deleteItem(995, 35000000); player.getInventory().addItem(14484, 1); }
And that's it hope this helps you in your furture coding. | |
|
Chex
Posts : 4 Reputation : 0 Join date : 2010-06-15
| Subject: Re: Caelum Base Making a command cost money Tue Jun 15, 2010 8:21 pm | |
| Nice tut i can use this | |
|