Jump to content

Country Flag


Recommended Posts

Hello, is it possible to check if the player ip is (e.i: 142.168.42.44) and then setElementData to a (e.i flag.png)?

Because there is some players without country flag, And i'm trying to do it in a stupid way :?

That's my code.

exports.scoreboard:addScoreboardColumn('Home') 
      
function showcountry() 
local flag = exports.admin:getPlayerCountry ( source ) 
local ip = getPlayerIP( source ) 
 if flag then 
    setElementData(source,"Home",":admin/client/images/flags/"..flag..".png") 
 elseif ip == 142.168.42.44 then 
    setElementData(source,"Home",":admin/client/images/flags/flag.png") 
 else 
    flag ="N/A" 
 end 
end 
addEventHandler("onPlayerJoin",getRootElement(), showcountry) 

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