Tracks playtime and AFK time of players with optional rewards

Supported Games
GameServerKingsGameServerKings

Tracks user playtime, with option to separately track AFK time. Also includes a optional reward system to give players points/money for time played and for referring other players to your server.

You can also create custom permissions to give VIP players reward multipliers.

Chat Commands

  • /playtime -- Display your playtime

  • /playtime -- Display the playtime for the specified player

  • /playtime top -- Display the top 10 play times

  • /refer <playername or id> -- Specify a player that referred you for points to be issued to both players

Reward System

The reward system can be used to issue rewards in the form of RP (Server Rewards) or coins (Economics) to players based on their playtime, and for referring other players to the server.

Referral System

The referral system is simple. PlayerA invites PlayerB to the server. For the reward to be issued PlayerB simply has to type '/refer PlayerA'.

Once he/she has done this PlayerA will be given points for inviting a player (Referral_InvitePoints) and PlayerB will be given points for joining from a referral (Referral_JoinPoints).

Once PlayerB has registered his/her referral they can never use the system again, however they can invite as many player as they want to claim referral rewards

Reward Multipliers

You can use reward multiplers to increase the rewards given to VIP. The amount of the reward will be the default amount set in the config, multiplied by the number you set in the permission. Simply give your VIP players the desired permission for them to receive that reward multiplier

For example, if you create a permission called "playtimetracker.vip1" with a value of 1.5, and the reward amount is 5 (default amount), the reward for that user will be 7.5

You can configure reward multipliers in the config

Reward multiplers are applied to both playtime rewards and referral rewards

Configuration

{
  "General Options": {
    "Data save interval (seconds)": 900,
    "Track player AFK time": true,
    "Number of entries to display in the top playtime list": 10
  },
  "Reward Options": {
    "Reward plugin (ServerRewards, Economics)": "Economics",
    "Playtime rewards": {
      "Issue rewards for playtime": true,
      "Reward interval (seconds)": 3600,
      "Reward amount": 5
    },
    "Referral rewards": {
      "Issue rewards for player referrals": true,
      "Referrer reward amount": 5,
      "Referee reward amount": 3
    },
    "Custom reward multipliers (permission / multiplier)": {
      "playtimetracker.examplevip1": 1.5,
      "playtimetracker.examplevip2": 2.0
    }
  },
  "Version": {
    "Major": 0,
    "Minor": 2,
    "Patch": 0
  }
}

Developer API

object GetPlayTime(string playerid) // Returns double playtime in seconds, or null if no data found
object GetAFKTime(string playerid) // Returns double AFK time in seconds, or null if no data found
object GetReferrals(string playerid) // Returns int number of referrals, or null if no data found

MIT License


Copyright (c) 2020 k1lly0u


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.