Jump to content

The RuneLocus forum has been archived and does not accept new registrations.
Click here for more information, and click here to join the community on Discord.

Search the Community

Showing results for tags 'vote4rewards'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. Hello RuneLocus, I understand that many of you may have donators on your RSPS. So this tutorial is mainly aimed at those who wish to give their donators extra rewards when voting. Firstly you're going to search for your existing command, head over to Commands.java Then search for your claim/check command using Cntrl/Control/Command + F. My command for vote checking and giving rewards is ::claim so I'll search for " "claim" " This pulls up: [code] if (playerCommand.equalsIgnoreCase("claim")) { try { VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_")); if(reward != null){ switch(reward.getReward()){ case 0: c.getItems().addItem(995, 1000000); break; default: c.sendMessage("Reward not found."); break; } c.sendMessage("Thank you for voting."); } else { c.sendMessage("You have no items waiting for you."); } } catch (Exception e){ c.sendMessage("[RuneProject] Error: #SQLvoting; contact @[email protected] Max with this error!."); } }[/code] Now for creating a variable that will check for the players rank and give items accordingly. If you look at the code you will notice the reward is working inside a case number, this specific case has the ID of 0. [code] case 0: [/code] Inside is the reward for all players, which will be the reward for regular players after we have finished. I'm going to give my donators 2x the reward because I'm a nice guy.. So I'm going to create the following variable below the prementioned 'case 0' [code] if (c.playerRights == 6) { }[/code] Inside of the variable is the execution if the above condition is true, as my donator rank is of the integer 6, the inside code will be executed, but there is nothing there, yet! Inside I am going to add the double reward for donators: [code] if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); }[/code] Now if the client user has the player Rights/Rank of 6 which is the donator rank on my server(Yours may be different) it will get the item Item ID 995(Coins) and an amount of 2000000(2 Million) and add it to their inventory. But wait, if we replace everything inside case 0: with what I have just written only donators will be rewarded? That's where we add the Else statement. So we give everyone ELSE the usual reward. [code] if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); } else { c.getItems().addItem(995, 1000000); } [/code] To finish off, we will remove everything that was inside of Case 0, and add our new conditional code. It should look like this. [code] if (playerCommand.equalsIgnoreCase("claim")) { try { VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_")); if(reward != null){ switch(reward.getReward()){ case 0: if (c.playerRights == 6){ c.getItems().addItem(995, 2000000); } else { c.getItems().addItem(995, 1000000); } break; default: c.sendMessage("Reward not found."); break; } c.sendMessage("Thank you for voting."); } else { c.sendMessage("You have no items waiting for you."); } } catch (Exception e){ c.sendMessage("[RuneProject] Error: #SQLvoting; contact @[email protected] Max with this error!."); } }[/code] You can also have it announced to the community by adding: [code] PlayerHandler.announce("[SERVER] "+c.playerName+" has voted"); [/code] under every reward. Thank you for reading this tutorial, if any problems occur please feel free to reply/ send me a PM for extra help or a more detailed explanation.
  2. title says it all add my MSN [email][email protected][/email] and skype jedley3 (prefferable)
×