addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function()
exports.scoreboard:addScoreboardColumn("Total Win's")
end)
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),
function(pickupID, pickupType, vehicleModel)
if pickupType == "vehiclechange" and vehicleModel == 425 then
if getPlayerAccount(source) and not isGuestAccount(getPlayerAccount(source)) then
increaseAccountData(source)
outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter and get +1 win!",getRootElement(),25,125,225, true)
else
outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter, but wasn't logged in, login or register!",getRootElement(),25,125,225, true)
end
end
end)
function increaseAccountData(player)
local account = getPlayerAccount(player)
local accountData = getAccountData(account,"hunterPoints")
if not accountData then
setAccountData(account,"hunterPoints",1)
setElementData(player,"Total Win's",1)
else
setAccountData(account,"hunterPoints",tonumber(accountData)+1)
setElementData(player,"Total Win's",tonumber(accountData)+1)
end
end
addEventHandler("onPlayerLogin",getRootElement(),
function()
local account = getPlayerAccount(source)
local points = getAccountData(account,"hunterPoints")
if not points then
setElementData(source,"Total Win's",0)
else
setElementData(source,"Total Win's",points)
end
end)
Try, its kinda morning here maybe i made something wrong