Top Serveurs
This script allows your players to vote for your server on Top-Serveurs directly from the game.
Client Side
Command to enter in the in-game chat:
/vote
Client Event
-- Client Side
TriggerEvent("redrp-bt:showVoteUi")
Server Side
Server Event
TriggerClientEvent("redrp-bt:showVoteUi", source)
Here is an excerpt from the config file: (some parts are hidden) :--
Config = {}
Config.serverToken = "" -- SERVER TOKEN
Config.serverURL = "https://top-serveurs.net/rdr/vote/revealed-fr-free-access-serious-rp" -- IMPORTANT: Keep the /vote/ before the server name
-- Discord Staff Webhook
Config.DiscordWebhook = "" -- Discord canal webhook (ex : https://discord.com/api/webhooks/1212121212/StmZ_AazZZykg69RY1gRZnp7h4121212AZAbAbBlWxyJzaMq)
Config.DiscordName = "BT_TOPSERVER" -- The title of the Discord message.
-- Vote Command
Config.enable_command = true -- Enables the /vote command (or other custom command)
Config.command = "vote" -- /vote
Config.enable_client_side = true -- Enables the redrp-bt:showVoteUi event (or other custom command)
Config.client_function = 'redrp-bt:showVoteUi' -- Function call: Client Side TriggerEvent("redrp-bt:showVoteUi") or ServerSide TriggerClientEvent("redrp-bt:showVoteUi", source)
--
Config.NotifyAllPlayersOnVote = true -- When a player votes, a notification is sent to all players
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", -- %d Amount, %s Currency (e.g., 4 $)
WinWeapon = "Thank you for your vote, congratulations, here is a weapon: %s", -- %s Weapon name (e.g., Machete)
WinItem = "Thank you for your vote, you have won: %d %s", -- %d Quantity, item name (e.g., 1 Apple)
VoteAgain = "You can vote again on Top-Serveurs",
NotifyAll = "%s has voted for the server! (/vote)" -- %s Player identity (e.g., Botia Olia)
}
Config.Prices = {
["$"] = { chance = 40, min = 1, max = 3 },
["Gold"] = { chance = 30, min = 1, max = 2 },
["Items"] = {
chance = 15, -- 15% chance of getting an item
ItemList = {
["ammoarrowdynamite"] = { label = "Dynamite Arrow", chance = 3, min = 1, max = 3 },
[...] -- hidden
}
},
["Weapons"] = {
chance = 10, -- 10% chance of getting a weapon
WeaponList = {
["WEAPON_MELEE_TORCH"] = { label = "Torch", chance = 5 },
[...] -- hidden
}
}
}
-- ### NOTIFICATION ### DO NOT TOUCH IF YOU DON'T KNOW
-- Function used for : Config.Txt.WinItem, Config.Txt.WinMoneyGold, Config.Txt.WinWeapon and Config.Txt.NotifyAll
function SendValidNotification(source, message)
-- hidden
end
-- Function used for : Config.Txt.AlreadyVoted
function SendErrorNotification(source, message)
-- hidden
end
-- Function used for : Config.Txt.VoteAgain
function SendInfoNotification(source, message)
-- hidden
end
Last updated