Jump to content
  • 0
Sign in to follow this  
kendalpure

changing a few items

Question

i was wondering how to make tickets so that players can click them to claim donor points, status or vote points, does anybody know how to accomplish such a feat?

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
clicking them would be in clickingmost.java or something like that, you can also make a command like ::claim, ::vpoint or something along those lines and make it check if the player has an item, if they do deletes the item, and adds vote points or whatever you want ot give them. (sorry i cant elaborate or explain better, im posting this from my phone)

Share this post


Link to post
Share on other sites
  • 0
[quote name='kendalpure']i was wondering how to make tickets so that players can click them to claim donor points, status or vote points, does anybody know how to accomplish such a feat?[/QUOTE]

Create variables in the Mob class that defines the player, e.g. Player.java, and add these;

[code]
private int donorPoints, votePoints;

public int getDonorPoints() {
return donorPoints;
}
public int getVotePoints() {
return votePoints;
}
public void setDonorPoints(int points) {
this.donorPoints = points;
}
public void setVotePoints(int points) {
this.votePoints = points;
}
[/code]

Now you want to go into your inventory interface handler. The class which handles the buttons for the interface, and add something similar to this;
[code]
player.setDonorPoints(player.getDonorPoints() + 1);
player.setVotePoints(player.getVotePoints() + 1);
[/code]

Hope I helped.

Share this post


Link to post
Share on other sites
  • 0
What Format said but in 317 format:

player.java instead of mob.java and for your inventory use clickingbuttons or something.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×