Jump to content

Scoreboard Flags


RenanPG

Recommended Posts

Hi folks, i want to create a Flag system, someone can help me?

CODE:

exports.scoreboard:addScoreboardColumn ( 'Home' ) 
  
function showcountry ( ) 
    local flag = exports.admin:getPlayerCountry ( source ) or "US" 
    setElementData ( source, "Home", { ":admin/client/images/flags/".. flag ..".png", flag } ) 
end 
addEventHandler ( "onPlayerJoin", root, showcountry ) 
addEventHandler ( "onPlayerChat", root, showcountry ) 
 

and i setted this on scoreboard:

                                elseif column.name == "Home" then 
                                dxDrawImage( topX+theX, y+s(1), 16, 11, content [ 1 ], 0, 0, 0, cWhite, drawOverGUI ) 
                                dxDrawText ( tostring ( content [ 2 ] ), topX+theX + 5, y+s(1), 16, 11, cWhite, 1, "default", "right", "bottom", true, false, drawOverGUI ) 
 

The flags is ok, but don't show the country.

 

i want something like this:

 

Link to comment

If you still need:

exports.scoreboard:addScoreboardColumn ( 'Home' ) 
  
function showcountry ( ) 
    local flag = exports.admin:getPlayerCountry ( source ) or "US" 
    setElementData ( source, "Home", flag) 
end 
addEventHandler ( "onPlayerJoin", root, showcountry ) 
addEventHandler ( "onPlayerChat", root, showcountry ) 
  

elseif column.name == "Home" then 
                                dxDrawImage( topX+theX, y+s(1), 16, 11, ":admin/client/images/flags/"..content..".png", 0, 0, 0, cWhite, drawOverGUI ) 
                                dxDrawText( string.upper(content), topX+theX+23,        y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 

that should work

Link to comment
If you still need:
exports.scoreboard:addScoreboardColumn ( 'Home' ) 
  
function showcountry ( ) 
    local flag = exports.admin:getPlayerCountry ( source ) or "US" 
    setElementData ( source, "Home", flag) 
end 
addEventHandler ( "onPlayerJoin", root, showcountry ) 
addEventHandler ( "onPlayerChat", root, showcountry ) 
  

elseif column.name == "Home" then 
                                dxDrawImage( topX+theX, y+s(1), 16, 11, ":admin/client/images/flags/"..content..".png", 0, 0, 0, cWhite, drawOverGUI ) 
                                dxDrawText( string.upper(content), topX+theX+23,        y,      topX+x+s(column.width),     y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ),          tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) 

that should work

Thank you, i'll try it.

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