Jump to content

Question

Is there a way to make a command where it's only useable once per day?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Easy... Date.java or use long

Share this post


Link to post
Share on other sites
  • 0
Maybe give me an example?

[COLOR="silver"]- - - Updated - - -[/COLOR]

Maybe give me an example?

Share this post


Link to post
Share on other sites
  • 0
public void castVeng() {
if (c.playerLevel[6] < 94) {
c.sendMessage("You need a magic level of 94 to cast this spell.");
return;
}
if (c.playerLevel[1] < 40) {
c.sendMessage("You need a defence level of 40 to cast this spell.");
return;
}
if (c.teleTimer > 0) {
return;
}
if (!c.getItems().playerHasItem(9075, 4)
|| !c.getItems().playerHasItem(557, 10)
|| !c.getItems().playerHasItem(560, 2)) {
c.sendMessage("You don't have the required runes to cast this spell.");
return;
}
[COLOR="#FF0000"]if (System.currentTimeMillis() - c.lastCast < 30000) {
c.sendMessage("You can only cast Vengeance every 30 seconds.");[/COLOR]
return;
}

Just use the red code onto a command (it's only an example you must edit / make it fit with what you need ) and you can check in your source / other source there's alot of example

Share this post


Link to post
Share on other sites

×