Jump to content

[Help] Scoreboard


EMillion

Recommended Posts

Quote

function onPlayerQuitFromServer()
    if isPlayerLogged(source) then
        declinePVPForPlayer(source)
        addValue(source,"timePlayed",getTickCount()-getElementData(source,"timeLogged"))
        setElementData(source,"timeLogged",getTickCount())
    end
end
addEventHandler("onPlayerQuit",getRootElement(),onPlayerQuitFromServer)


function makeScoreboardColumns()
    call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Cash",getRootElement(),70)
    call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Points",getRootElement(),70)
    call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Rank",getRootElement(),70)
end


function refreshScoreboard(thePlayer)
    if isPlayerLogged(thePlayer) then
        local playerCash = getPlayerData(thePlayer,"cash")
        local playerPoints = getPlayerData(thePlayer,"EXP")
        setElementData(thePlayer,"Cash","$"..playerCash)
        setElementData(thePlayer,"Points",playerPoints)
    else
        setElementData(thePlayer,"Cash","Guest")
        setElementData(thePlayer,"Points","Guest")
        setElementData(thePlayer,"Rank","?")
    end
end

 ERROR: userpanel/core_server.lua:96: call: failed to call 'scoreboard
[20:27:04] ERROR: userpanel/core_server.lua:97: call: failed to call 'scoreboard

[20:27:04] ERROR: userpanel/core_server.lua:98: call: failed to call 'scoreboard

[20:27:04] ERROR: userpanel/core_server.lua:98: call: failed to call 'scoreboard

 

 

 

 


 

 


Edited by EMillion
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...