PS: You can activate and configure the voting plugin later if you wish in the panel of your server page.
- Download the plugin here: https://top-games.net/plugin/cfx/latest or directly on our Github page: https://github.com/Top-Serveurs/cfx-vote-plugin
- Copy the vote directory in the resources directory of your RedM server
- Configure the voting plugin in the vote/config.ini file like that:
Attention: The port should free and open in UDP, it should be different from your RedM server. This port is used to listen to the votes cast on your server page.
# The token is mandatory. It is the token of your server page (which will be available on your panel).
set vote_token "XXXXXXXXX"
# The listening port of the plugin. Default port is 8192 but you can specify which one you want. Don't forget to configure it in the form below as well.
set vote_port "8192"
- Indicate the port you just configured (or the default port 8192) in the field below
- Edit your server.cfg file for activate the plugin. Just add the following line:
AddEventHandler('onPlayerVote', function (playername, ip, date)
-- Add actions here when a vote is received.
-- For example: give In-Game money, give points, save in DB, ...
- Use the onPlayerVote event for receive the votes. An example is available in the vote/example.lua file and in the example_esx.lua file for a little example with ESX (remember to delete the examples). Here's an example: