local Proxy = module("vrp", "lib/Proxy")
local vRP = Proxy.getInterface("vRP")
AddEventHandler("centralcart.ready", function()
local CentralCart = exports[GetCurrentResourceName()]
-- addPremium {client_identifier}
CentralCart:registerCommand("addPremium", function(user_id)
local source = vRP.getUserSource(user_id)
-- Verificamos se o jogador está offline
if not source then
-- Aqui criamos um agendamento, isso vai fazer o comando ser
-- executado assim que o player se conectar ao servidor
CentralCart:schedule(user_id, "addPremium", { user_id })
return "OK (Scheduled)"
end
if not vRP.UserPremium(user_id) then
vRP.SetPremium(user_id)
end
end)
end)