Jump to content

Country Flag


Recommended Posts

Posted

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) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

And how i can define the player ip?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
And how i can define the player ip?
elseif ip == "142.168.42.44" then --strings "" 

Thanks.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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