Jump to content

Scoeboard Country


Forrest

Recommended Posts

Right, I've been making a country on the scoreboard resource for my Race servers, but I seem to be having some problems.

Here's my script..

    exports.scoreboard:addScoreboardColumn('Country') 
    function showcountry() 
    local country = exports.admin:getPlayerCountry ( source ) 
        if country then 
        setElementData(source,"Home","..country..") 
        else 
        country = "N/A" 
        end 
    end 
    addEventHandler("onPlayerJoin",getRootElement(),showcountry) 

And I've got this in the admin group on the ACL, so..?

Ps. I'm a complete noob, this is just something for me to learn, please go easy..

Link to comment
exports.scoreboard:addScoreboardColumn ( 'Country' ) 
  
function showcountry ( ) 
    local country = ( exports.admin:getPlayerCountry ( source ) or "N/A" ) 
    setElementData ( source, "Country", country ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), showcountry ) 

1: Your colum name is 'Country' not 'Home'.

2: The dots in setElementData and the quotes aren't required at all.

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...