Jump to content
General

[PI]Basic server sided vote for cash[PI]

Recommended Posts

Okay... I'm just gonna get right to it.

Client class and search for "Welcome to" and beneath that add

[CODE]if (voteTimer > 0) {
sendMessage("You have already voted, you will have to wait "+voteTimer+" seconds.");
} else {
sendMessage("Please type ::vote to recieve 5M every 24 hours!");
}[/CODE]


same class find process method and add

[CODE]if (voteTimer > 0) {
voteTimer--;
}[/CODE]

open player.java and add

[CODE]public int voteTimer = 0;[/CODE]

now open commands class and add

[CODE]f (playerCommand.startsWith("vote")) {
if (c.voteTimer == 0) {
c.getPA().sendFrame126("www.runelocus.com/toplist", 12000);
c.getItems().addItem(995, 5000000);
c.sendMessage("Thank you for voting for Rune-Regrets.");
c.sendMessage("5M has been added to your inventory.");
c.voteTimer = 86400;
} else {
c.sendMessage("You have already voted today, try again in "+c.voteTimer+" seconds.");
}
}[/CODE]

now open playersave and add

[CODE]} else if (token.equals("vote-timer")) {
p.voteTimer = Integer.parseInt(token2);[/CODE]

and

[CODE]characterfile.write("vote-timer = ", 0, 13);
characterfile.write(Integer.toString(p.voteTimer), 0, Integer.toString(p.voteTimer).length());
characterfile.newLine();[/CODE]

Thanks ;)

Share this post


Link to post
Share on other sites
Soo. It opens an interface saying the toplist link? I'd make ::vote a client command aswell, so when you type it, it can open up the url for you.
Players will just ::vote ::reward either way though. :S

Share this post


Link to post
Share on other sites
Not bad... But I mean it could easily be cheated from people just making multiple accounts and then transferring the cash.

Share this post


Link to post
Share on other sites
[quote name='MonarchX']Soo. It opens an interface saying the toplist link? I'd make ::vote a client command aswell, so when you type it, it can open up the url for you.
Players will just ::vote ::reward either way though. :S[/QUOTE]

Do you know how to code?

[code]
if (c.voteTimer == 0) {
c.getPA().sendFrame126("www.runelocus.com/toplist", 12000);
c.getItems().addItem(995, 5000000);
c.sendMessage("Thank you for voting for Rune-Regrets.");
c.sendMessage("5M has been added to your inventory.");[/code]

now look at :

[code]
c.getPA().sendFrame126("www.runelocus.com/toplist", 12000);
[/code]

Opens up a link to runelocus toplist, which you can change to your vote link...

Share this post


Link to post
Share on other sites
Yeah.. but it doesn't open it up for you, does it?
Players arent ognna do shit they're just gonna type ::vote and get the reward

Share this post


Link to post
Share on other sites
yes it does... it opens the link up, and they most likely will why raise cash on a server if ur helping it fail ;) and its BASIC LIKE I SAID end off...

Share this post


Link to post
Share on other sites
[quote name='MonarchX']Yeah.. but it doesn't open it up for you, does it?
Players arent ognna do shit they're just gonna type ::vote and get the reward[/QUOTE]
It does open up a link....
[COLOR="#FF0000"]c.getPA().sendFrame126("Insert Link Here", 12000);[/COLOR] Tha code opens up a link....
So having it as [code]c.getPA().sendFrame126("[COLOR="#008000"]http://runelocus.com/toplist[/COLOR]", 12000);[/code] will open up a browser to the link in the Green...

Share this post


Link to post
Share on other sites
Well my bad
Ive always used client sided for that

:facepalm:

Share this post


Link to post
Share on other sites

×