Plugins
FiveM Vote Plugin (Grand Theft Auto)
Our plugin automatically detects when a player votes for your server on our site. You can set the reward given to them after voting. For instance, giving them money or an in-game item. Our plugin is compatible with all versions of FiveM servers and ESX.
- Download the vote plugin.
- Upon unzipping the file, an sp-vote folder will be created.
- Open the sp-vote/config.lua file and fill in Config.Token with your server's token and Config.MoneyEarned with the amount to be awarded per player vote.
- Execute the SQL file sp-vote/votehistory.sql in PhpMyAdmin or HeidiSQL; this table will save the votes.
- If you wish to modify the type of reward, go to sp-vote/server/main.lua and modify the reward function.
- Drag and drop sp-vote into the resources folder of your FiveM server.
- Add to your server.cfg at the bottom the text start sp-vote or ensure sp-vote to activate the plugin.
Sample code
Sample code to reward players (Outside of the plugin's standard rewards)
RegisterServerEvent("sp-vote:newVoteOnline")
AddEventHandler("sp-vote:newVoteOnline", function(player)
// your code
end)
RegisterServerEvent("sp-vote:newVoteOffline")
AddEventHandler("sp-vote:newVoteOffline", function(vote)
// your code
end)
No need to open a connection port, we do not send UDP requests. Our plugin calls our API and refreshes the voters list every 30 seconds.