Log in Add Server

FiveM Vote Plugin (Grand Theft Auto)

Reward players in game when they vote for your server on Private Server. The plugin uses ESX, QBCore, or Qbox and requires oxmysql and FiveM server build 9515 or newer.

Download version 2.0

Installation

  1. Download the ZIP above and extract the sp-vote folder into your FiveM server’s resources folder.
  2. Install oxmysql and configure its connection to your server’s database.
  3. In sp-vote/config.lua, set Config.Framework = 'auto', 'esx', 'qbcore', or 'qbox'.
  4. Set Config.Token to your Private Server listing’s API token from its management area. Keep it private.
  5. Set Config.Locale to 'fr' or 'en' and Config.Reward.Money to the amount per vote: 500 by default.
  6. In server.cfg, start ensure oxmysql, then your framework (ensure es_extended, ensure qb-core, or ensure qbx_core), then ensure sp-vote.
  7. On startup, the plugin automatically creates or updates the sp_vote_rewards table. The SQL user must be allowed to create and alter this table. No SQL file import is required.

The same ZIP includes French and English player messages. Config.Locale selects their language; source code and console messages are in English.

Claim a reward

Vote on your server’s listing with your exact FiveM player name, not your RP character’s name. The plugin fetches votes every 30 seconds and automatically grants rewards in game, with no command to enter. Pending rewards are kept until your next connection.

A player name can be changed and is not proof of identity.

The history is cleaned automatically every hour. A paid or cancelled vote is removed only when both the vote and its payment or cancellation are more than 7 days old. Pending votes and votes awaiting review are always kept.

Configure the reward

To award 500 units of money per vote, set this value in sp-vote/config.lua:

Config.Reward.Money = 500

ESX, QBCore, and Qbox examples

These examples deposit 750 into the player’s bank account. Choose one example for your framework and place it in sp-vote/config.lua. Config.Reward.Handler replaces the Config.Reward.Money reward. No client changes are needed.

ESX

Config.Reward.Handler = function(source, player, vote)
    if not player.getAccount('bank') then
        return false
    end
    return player.addAccountMoney('bank', 750, 'serveur-prive-vote') ~= false
end

QBCore

Config.Reward.Handler = function(source, player, vote)
    return player.Functions.AddMoney('bank', 750, 'serveur-prive-vote') == true
end

Qbox

Config.Reward.Handler = function(source, player, vote)
    return exports.qbx_core:AddMoney(source, 'bank', 750, 'serveur-prive-vote') == true
end

The function receives source (the connected player’s ID), player (the framework object), and vote (voted_at, username, player_identifier: the character’s prefixed persistent identifier). Return true only after giving the reward; false means no reward was given and allows a retry on the next pass, about every 30 seconds. An error or missing return holds the vote for manual review. After checking the payment, run sp_vote_resolve <voted_at> rewarded <username...> in the server console if it was paid, or sp_vote_resolve <voted_at> retry <username...> otherwise.

Events before and after the reward

sp-vote:preVoteReward(playerSource, vote) runs before the reward. Call CancelEvent() to cancel it permanently, with no retry.

sp-vote:postVoteReward(playerSource, vote) runs after a successful reward, for your logs or notifications.

Server-side example: cancel the reward outside routing bucket 0 and log granted rewards.

AddEventHandler('sp-vote:preVoteReward', function(playerSource, vote)
    if GetPlayerRoutingBucket(playerSource) ~= 0 then
        CancelEvent()
    end
end)

AddEventHandler('sp-vote:postVoteReward', function(playerSource, vote)
    print(('[sp-vote] Reward confirmed for %s (source %s, player %s, vote %s)'):format(
        vote.username, tostring(playerSource), vote.player_identifier, vote.voted_at
    ))
end)

vote contains username, voted_at, and player_identifier. playerSource is the player’s ID: in the post event, it may be nil after a disconnect or character change. Check it before using it; vote.player_identifier remains available.

The plugin calls our API from your server. No additional UDP port needs to be opened.

Available versions

Version Size Date Action
V2.0 11.8 KB 28th Sep 2026 Download

Discord bot

One bot, two ways to use it: follow your favorite game servers from your Discord account, or link your community’s Discord server to your Private Server listing to encourage votes and track activity.

For players

Add your favorite servers and enable reminders so you never miss a vote.

  • Keep up to 25 favorite servers handy and easily access their voting links.
  • Enable reminders for the favorites you choose: after each vote, get a DM when you can vote again.
  • View your favorites’ leaderboards, statistics and reviews directly in Discord.

Add to my Discord account

  1. In /profile, search for a server by name or paste its SP page link, then add it to your favorites.
  2. Enable reminders for a favorite. After each vote, the bot tells you when you can vote again. Stop reminders at any time.
  3. Keep the prefilled Discord name so the bot can recognize your votes.
  4. You can also choose your language in /profile.

Some servers require voting through their website or Discord. The bot guides you and tells you whether reminders are available. The server’s page and statistics remain accessible.


For servers

Encourage your community to vote for your game server and recognize your voters in Discord.

  • Make voting easy with a dedicated panel and automatically thank voters in a channel.
  • Display an updated voter leaderboard and post new reviews in the channels you choose.
  • Offer reminders by DM or in a channel, enabled by each member, and view detailed statistics for your server.

Add to my Discord server

  1. You need the Manage Server permission to install the bot. In /config, enter your SP listing’s API token from its management area. Keep it private.
  2. Publish a voting panel and choose channels for automatic thank-you messages, the voter leaderboard and new reviews.
  3. Set reminders to DMs, a channel, or off. Each member enables their own reminders.
  4. The language follows your SP listing. Choose French or English in /config if needed.

Set up a custom voting URL

In your SP listing settings, choose “Custom URL” to open your platform from the vote button. You must include {discord_username} to pass the player’s Discord name.

https://example.com/vote?username={discord_username}

Keep this name and pass it to Private Server when the player votes so the bot can send reminders.

With OTP, your platform must generate its own token and pass it to the SP vote for validation. The bot adds no token to your URL.