Pay rewards without a plugin
One PHP file runs next to your game. It asks VoteScript who earned what and pays it.
Payout by SQL or RCON4 steps
What you need
- PHP 7.2 or newer on the command line
- A login to your game database, or RCON
- An API key
Start it once
Put the file on a machine that reaches your database or console, and run it. The first start writes the settings file.
$ php votescript-delivery.php
Created votescript.ini. Fill it in and start again.
Fill in the settings
Choose the mode. The page of your game has a filled-in example, if we know one.
[votescript] url = "https://votescript.voterank.net" key = "YOUR_KEY" mode = "sql" [database] dsn = "mysql:host=127.0.0.1;dbname=YOUR_DATABASE;charset=utf8mb4" user = "" password = "" [sql] points = "UPDATE accounts SET vote_points = vote_points + :amount WHERE name = :player" check = "SELECT 1 FROM accounts WHERE name = :player"
[votescript]
url = "https://votescript.voterank.net"
key = "YOUR_KEY"
mode = "rcon"
[rcon]
host = "127.0.0.1"
port = 25575
password = ""
retry_if = "No player was found"
[commands]
default = "give {player} {key} {amount}"[votescript]
url = "https://votescript.voterank.net"
key = "YOUR_KEY"
mode = "tshock"
[tshock]
url = "http://127.0.0.1:7878"
token = ""
retry_if = "Invalid player"
[commands]
default = '/give {key} "{player}" {amount}'Match the keys
The word before the statement is the reward key. In the example it is points, so the reward in your dashboard must have the key points.
Reward for every vote
Start it and vote
Run it again and send a test vote from your dashboard. Keep it running, or run it with --once from cron.
$ php votescript-delivery.php
Iron Moss: paid 10 x Vote points
If it does not work
A reward waits and waits
It stops with a message about rows
Fill in the key
SQL Server
Next
GuideConnect your gameWhen a player types your command, the game asks VoteScript what is waiting and hands it out.
GuideRewards, bonuses and streaksStart with one reward per vote: an item, a day of VIP, a title, a teleport. Add a bonus and a streak when the first one works.
GuideCommon problemsFollow one vote from the click to the game. Stop at the first step that does not look like the picture.
Give your players one place to vote
Your page is live as soon as you create your server. You can connect the rest step by step.

