Vote Checker & Rewarder

Give rewards to users for voting on game-servers.top & reign-of-kings.net

Total Downloads: 823 - First Release: Jun 29, 2015 - Last Update: Feb 15, 2016

5/5, 6 likes
  1. Pho3niX90 submitted a new resource:

    Votes Checker - Checks votes against rok.net

    Read more about this resource...
     
  2. Wulf

    Wulf Community Admin

    I've gone ahead and conditionally approved this, but I there are some issues that need to be fixed. I've attached the working plugin below with suggested changes and some necessary cleanup, as currently your plugin doesn't even load due to improper versioning. The rename is also recommended.
     

    Attached Files:

  3. is it only raw resources then?
     
  4. Do we have to change the cyberscene web request to the rok.net one? Not sure what we need to do to this plugin, if anything.
     
  5. I'm totally digging this plugin but as Andrew said I have no clue what to edit.
    Is it possible to enter a few resources? Like Stone and Wood?
    Also, what's the range of items that can be awarded and do they just have standard RoK names? Like wood for wood, and iron for iron sort of thing?


    EDIT:
    Tried with the default settings just changed the API, didn't work :\
    Maybe I'm doing something wrong?
     
    Last edited by a moderator: Jun 30, 2015
  6. Pho3niX90 updated Votes Checker with a new update entry:

    Vote Checker


    [DOUBLEPOST=1435647147][/DOUBLEPOST]The only think to change is to add your API key and the resource to be given. The cyberscene call is to a webservice I created to communicate to both rok.net and steam to get the correct username/persona per steamid.
    [DOUBLEPOST=1435647201][/DOUBLEPOST]
    Thank you.

    I noticed the versioning issue only once uploaded and couldn't change it until it was approved.
    [DOUBLEPOST=1435647383][/DOUBLEPOST]These are the ones you edit.

    //VARS for game usage
    string resource = "STONE"; //resource to give
    string rokDotNet_api = "cym0xuou1vhvaowkx9h3ghgdbl72un7f35"; //this is your reign-of-kings.net server api found http://reign-of-kings.net/servers/manage/
    int amount = 1000; // this gets rewarded for every vote
     
  7. Pho3niX90 updated Votes Checker with a new update entry:

    Votes Checker


    [DOUBLEPOST=1435647642][/DOUBLEPOST]
    Did you receive any type of error?
     
  8. No I didn't receive any error, I'm going to download the new updated script and give it another go
     
  9. Okay.

    Just as a note. It only rewards 30 seconds after you have logged on
     
  10. But if the player is in-game, does he have to relog?
    [DOUBLEPOST=1435648217][/DOUBLEPOST]AWESOME, its working OMG I LOVE YOU!!!
    Btw, is there a way to award more than 1 resource at a time? and to set different amounts for said resource?
     
  11. Awesome - I'll have a play with this tonight!
     
  12. i am glad it's working :D

    at this point not yet. I am thinking of adding incremental rewards for example.

    User voted 1 time, give him simple raw resources
    User voted 2 times, give him 2 raw resources
    User voted 3 time, give a crafted item

    And so forth, Any inputs? The reason for the above is to give the users a reason to vote each day..
     
  13. If you extract the functionality of OnPlayerConnected( ) to its own method, you can then also create a player command to allow players to run this code without having to log out / in again.

    Player uses command: /getreward

    Code:
    [ChatCommand("getreward")]
    private void GetMyVoteReward(Player player, string cmd)
    {
        GetRewardsForThisPlayer(player);
    }void OnPlayerConnected(Player player)
    {
        GetRewardsForThisPlayer(player);
    }void GetRewardsForThisPlayer((Player player)
            {
                if (player.Name.ToLower() == "server") return;
                WebRequests webRequests = Interface.GetMod().GetLibrary<WebRequests>("WebRequests");
               
                var playerId = player.Id;            timer.Once(30, () => webRequests.EnqueueGet("http://cyberscene.co.za/rok-api.php?steamid=" + playerId + "&api=" + rokDotNet_api, (code, response) => WebRequestCallback(code, response, player), this));        }
     
  14. Thanks scorp. I have made the addition and will upload the new version tonight. Just need to do an external configuration file as well for ease of use.
     
  15. Spanky! :p
     
  16. Great work!

    Would definitely love a way to give more than one item per vote. Like both Wood and Stone at the same time for each vote.
     
  17. Incremental could be good as long as it doesn't multiply by itself but the server admin sets the amounts of resources rewarded for each vote.
    As in 1 vote 500 stone, 2 vote 750, 3 vote 1k , etc etc, otherwise it will get out of hand pretty quick.

    But I def second Andrew's request, 2 resource rewards would be AMAZING.
    Working like a charm btw, loving it!

    Keep up the awesome work!
     
  18. Okay will make those changes today
     
  19. Awesome plugin great work! This can be very easily controlled since the voting system only allows one vote every 14 hours per a player too.
     
  20. Pho3niX90 updated Votes Checker with a new update entry:

    Votes Checker


    [DOUBLEPOST=1435684160][/DOUBLEPOST]You will be able to setup rewards per vote amount, and give multiple rewards as you like
    Code:
            string rokDotNet_api = ""; //this is your reign-of-kings.net server api found here -> http://reign-of-kings.net/servers/manage/        public List<Reward> Rewards = new List<Reward>();        void Init()
            {
                //Add you rewards here, first is the resource name, second is the votes required to receive the reward, and third is the amount to give.
                Rewards.Add(new Reward("Stone", 1, 1000));
                Rewards.Add(new Reward("Wood", 1, 1000));
                Rewards.Add(new Reward("Cobblestone block", 2, 100));
                Rewards.Add(new Reward("Iron", 2, 500));
                Rewards.Add(new Reward("Oil", 2, 500));
                Rewards.Add(new Reward("Whip", 3, 1));
                Rewards.Add(new Reward("Charcoal", 2, 500));
                Rewards.Add(new Reward("Steel Greatsword", 10, 1));
            }