πŸ₯‡Top Serveurs

πŸ—³οΈ Top-Serveurs Vote System – In-Game Voting & Rewards


⚑ Getting Started

Players can vote for your server on Top-Serveurs directly from in-game, and instantly receive configurable rewards.


πŸ’¬ How to Open the Vote Menu

1. By Command

  • Enabled by default (Config.enable_command = true)

  • Players use the command set in Config.command (default: /vote)

2. Client Event

TriggerEvent("redrp-bt:showVoteUi")

3. Server Event

TriggerClientEvent("redrp-bt:showVoteUi", source)

βš™οΈ Configuration Example (config.lua)

Config = {}
Config.serverToken = "..." -- Your Top-Serveurs token
Config.serverURL = "https://top-serveurs.net/rdr/vote/your-server-name"

Config.DiscordWebhook   = ""        -- Discord webhook for staff notifications
Config.DiscordName      = "BT_TOPSERVER"
Config.enable_command   = true
Config.command          = "vote"
Config.enable_client_side  = true
Config.client_function  = 'redrp-bt:showVoteUi'
Config.NotifyAllPlayersOnVote = true -- Notify everyone when someone votes

-- Leaderboard config
Config.MaxVotersToDisplay = 5                -- Number of top voters in leaderboard
Config.LeaderboardRefreshInterval = 120      -- Minutes between leaderboard announcements

Config.Txt = {
    VoteForUs = "Vote for Western Raiders",
    AlreadyVoted = "Your vote has already been rewarded, thank you :)",
    WinMoneyGold = "Thank you for your vote, here is your reward: %d %s",
    WinWeapon = "Thank you for your vote, congratulations, here is a weapon: %s",
    WinItem = "Thank you for your vote, you have won: %d %s",
    VoteAgain = "You can vote again on Top-Serveurs",
    NotifyAll = "%s has voted for the server! (/vote)",
    LeaderBoardTitle = "**πŸ† Top Voters Leaderboard πŸ†**\n\n",
    LeaderBoardPlayer = "**%d.** `%s` β€” **%d votes**\n"
}

🎁 Rewards Structure

Set up your reward chances and prize pools in Config.Prices:

Config.Prices = {
    ["$"] = { chance = 40, min = 1, max = 3 },           -- 40% chance: Money (random amount)
    ["Gold"] = { chance = 30, min = 1, max = 2 },        -- 30% chance: Gold (random amount)
    ["Items"] = {
        chance = 15,
        ItemList = {
            ["ammoarrowdynamite"] = { label = "Dynamite Arrow", chance = 3, min = 1, max = 3 },
            -- ...many more (see config)
        }
    },
    ["Weapons"] = {
        chance = 10,
        WeaponList = {
            ["WEAPON_MELEE_TORCH"] = { label = "Torch", chance = 5 },
            -- ...many more (see config)
        }
    }
}
  • You can edit, remove, or add as many rewards as you want.

  • All labels and items/weapons must match your server’s inventory and database.


πŸ† Leaderboard

  • Displays top voters in-game

  • Number of voters and refresh interval are configurable:

    • Config.MaxVotersToDisplay

    • Config.LeaderboardRefreshInterval (minutes)


🟧 Notification System

  • SendValidNotification: Called when a player wins a reward.

  • SendErrorNotification: Called when the player has already been rewarded for their vote.

  • SendInfoNotification: Used for generic info (e.g., can vote again soon).

  • Discord Logging: All votes/rewards can be logged to your Discord using your webhook.


πŸ“Œ Notes

  • All menu texts, reward messages, and notifications are configurable in Config.Txt.

  • Notifying all players on each vote is enabled/disabled by Config.NotifyAllPlayersOnVote.

  • No SQL setup is required for basic operation, but leaderboard or advanced logging may require persistent storage.

  • For leaderboard and multi-vote support, ensure your identifiers and data saving logic are implemented correctly.

Last updated