This is the Top-Games/Top-Serveurs (https://top-games.net / https://top-serveurs.net) new votes plugin which is used to receive votes directly on your FiveM/RedM server. When a player votes, Top-Games directly notifies your server and you can thus reward your players or make a ranking of the best voters (by example), the possibilities are endless.
But what is FiveM for? FiveM allows you to create a GTA server, you can find in particular a GTA 5 RP on our site.
- Event
onPlayerVoteallowing the reception of the votes cast on your server file in real time! This therefore allows actions to be taken accordingly. Example: rewarding voters.
-
Copy the
cfx-vote-plugindirectory to theresourcesdirectory of your FiveM/RedM server -
Configure the voting plugin in your
server.cfgfile like this:
ensure cfx-vote-plugin
# The token is mandatory. It is the token of your server file available on your panel https://top-games.net
set vote_token "XXXXXXXXX"- Use the
onPlayerVoteevent to receive the votes cast. Some examples are available in theexample.luafile, in theexample_esx.luafile for a small example with ESX and in theexample_vorp.luafile for an example with the VORP framework (remember to delete the example files you don't need). Also, here is a basic example:
AddEventHandler('onPlayerVote', function (playername, date)
-- Add actions here when a vote is received.
-- For example: give In-Game money, give points, save in DB, ...
print(playername)
print(date)
end)-
Start your server. If you see the message
[VotePlugin] The vote plugin is active on the default server port, everything is fine! -
Last step: activate the voting plugin on the management panel of your server file. Go to https://top-games.net/gta in your server management, at the bottom there is a
Voting pluginsection. You need to activate the plugin by choosing "Vote plugin v3". Once the plugin is activated, you can click on the button to test the connectivity and then it's up to you!
If you need help setting up the plugin or if you have any suggestions, do not hesitate to contact us here: https://top-games.net/contact or at contact@top-games.net.
Thanks to our contributors who help us improve the plugin: