RenanPG Posted February 18, 2014 Share Posted February 18, 2014 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
Castillo Posted February 18, 2014 Share Posted February 18, 2014 I can't see the images you posted, upload them somewhere else. Link to comment
RenanPG Posted February 18, 2014 Author Share Posted February 18, 2014 I posted the images again. Link to comment
Castillo Posted February 18, 2014 Share Posted February 18, 2014 I can't seem them either, upload them to another site, not the same one. Try this one: http://imgur.com/ Link to comment
MTA Team 0xCiBeR Posted February 18, 2014 MTA Team Share Posted February 18, 2014 Maybe this will help? viewtopic.php?f=91&t=52867&start=30 Link to comment
RenanPG Posted February 18, 2014 Author Share Posted February 18, 2014 I copied the code used on scoreboard of this topics: viewtopic.php?f=91&t=52867&start=30 . But still dont working. Link to comment
Moderators Citizen Posted February 20, 2014 Moderators Share Posted February 20, 2014 ("Uping" this thread as requested in a PM) I need to see the line where the content variable is defined (I'm pretty sure it's a getElementData on "Home" but still want to be sure). Link to comment
Wei Posted February 21, 2014 Share Posted February 21, 2014 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
RenanPG Posted February 27, 2014 Author Share Posted February 27, 2014 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
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