Divinerscape

Divinerscape beta 562 And 508
 
HomeCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Latest topics
» Dota 6.78 Ai
Tue Feb 18, 2014 5:14 am by chaunnef

» Autodata 3.38 Suomi Torrent
Tue Feb 18, 2014 3:35 am by chaunnef

» Los Reyes De Arranque Puro Pinche Party Rar
Fri Feb 14, 2014 5:51 pm by chaunnef

» SEVER NEEDS WORK!
Sat Jun 16, 2012 11:48 am by mosf1415

» Keep spawning at falador??? when login with a new account
Mon Aug 16, 2010 8:22 am by Jimmy300114

» How to Add Costum items (like agile and H'ween stuff)
Sat Aug 14, 2010 8:35 am by Jimmy300114

» Making Npc's Talk???
Sat Aug 14, 2010 6:02 am by Jimmy300114

» How do you Make Construction and Making G.e Work???
Sat Aug 14, 2010 5:31 am by Jimmy300114

» omfg put the server on!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thu Aug 12, 2010 4:30 am by d3mons

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 Caelum Base Making a command cost money

Go down 
AuthorMessage
zeck
Owner
Owner


Posts : 27
Reputation : 3
Join date : 2010-01-17
Age : 27
Location : Florida

PostSubject: 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.
Back to top Go down
View user profile http://divinerscape.forumotion.com
Chex

avatar

Posts : 4
Reputation : 0
Join date : 2010-06-15

PostSubject: Re: Caelum Base Making a command cost money   Tue Jun 15, 2010 8:21 pm

Nice tut i can use this Smile
Back to top Go down
View user profile
 
Caelum Base Making a command cost money
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Divinerscape :: Html, C++, Java, Server Tutorials-
Jump to: