King12 Posted October 7, 2017 Share Posted October 7, 2017 Hello, I managed to export flag but I couldn't export country name in the same column. How can I do it? -- Script code exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) -- Scoreboard code elseif column.name == "Country" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) Link to comment
koragg Posted October 7, 2017 Share Posted October 7, 2017 Try this maybe. Flag files have lower letter names and admin panel shows big letters for countrycodes. Also just to be sure, forced the 'flag' to be a string. -- Script code exports.scoreboard:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..string.lower(tostring(flag))..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) -- Scoreboard code elseif column.name == "Country" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) Or have a look at how it's done in my scoreboard.zip here: http://www.mediafire.com/file/bk1ipa4vhq1swal/scoreboard.zip Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now