Jump to content

getPlayerIP


SkatCh

Recommended Posts

guys can anyone help me here :

function getPlayerCountry ( player ) 
    return getIpCountry ( getPlayerIP ( player ) )  <----- this line 
end 
  
function getIpCountry ( ip ) 
    local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) <------- This line 
    local ip_code = ( gettok ( ip, 1, 46 ) * 16777216 ) + ( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) <------ this line 
    if ( #aCountries == 0 ) then 
        loadIPGroups () 
    end 
    if ( not aCountries[ip_group] ) then 
        aCountries[ip_group] = {} 
    end 
    for id, group in ipairs ( aCountries[ip_group] ) do 
        if ( ( group.rstart <= ip_code ) and ( ip_code <= group.rend ) ) then 
            return group.rcountry 
        end 
    end 
    return false 
end 

Warning :

1- Bar argument @ 'getPlayerIP' [Excepted Element At argument 1, got nil]

2- Bar argument @ 'gettok' [Excepted String At argument 1, got boolean]

3- Bar argument @ 'gettok' [Excepted String At argument 1, got boolean]

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