Integra facilmente il sistema di voto Top-Games al tuo server RedM e ricompensa i tuoi giocatori in tempo reale con ricompense western autentiche.
Scarica l'ultima versione del plugin dal nostro repository GitHub. Lo stesso plugin funziona per FiveM e RedM.
Scarica v3
Estrai e copia il contenuto della cartella cfx-vote-plugin
nella directory resources/vote
del tuo server RedM.
resources/vote
Ottieni il tuo token dal pannello Top-Games.
Aggiungi le seguenti righe al tuo file server.cfg
:
ensure vote
set vote_token "IL_TUO_TOKEN_QUI"
Attivare il "Plugin di voto v3" nel pannello Top-Games. Puoi testare il plugin cliccando su "Testa connettività" e simulare un voto.
Il plugin attiva automaticamente l'evento onPlayerVote
quando un giocatore vota per il tuo server RedM.
-- Esempio di utilizzo base per RedM
AddEventHandler('onPlayerVote', function(playername, date)
print('Nuovo voto ricevuto sul server RedM!')
print('Cowboy: ' .. playername)
print('Data: ' .. date)
-- Aggiungi qui la tua logica delle ricompense western
end)
-- Configurazione specifica per VORP Framework
local VORP = exports.vorp_core:GetCore()
TriggerEvent("getCore", function(core)
VORP = core
end)
AddEventHandler('onPlayerVote', function(playerid, date)
local User = VORP.getUser(playerid)
if User then
local Character = User.getUsedCharacter
local name = Character.firstname .. " " .. Character.lastname
print("Vote received from: " .. name)
-- Ricompensa in contanti e oro
Character.addCurrency(0, 50.0) -- Contanti
Character.addCurrency(1, 2.0) -- Oro
-- Notifica VORP
TriggerClientEvent("vorp:TipRight", playerid, "Grazie per il tuo voto! +50$ e 2 Oro", 4000)
end
end)
resources/
ensure vote
sia in server.cfg
server.cfg
AddEventHandler
print()
per il debugHai bisogno di aiuto per configurare il plugin su RedM? Il nostro team conosce l'universo western.