Jump to content

country block


Recommended Posts

hi

im blocking a country but i want to let my friend play(he's an exception)

heres my code

local countries = 
    { 
        [ "PT" ] = true 
    } 
local serials = 
    { 
        [ "B1E80345047CC71F1F5C427C581C4D94" ] = true 
    } 
  
function paises ( ) 
    local gCountry = exports.admin:getPlayerCountry ( source ) or "N/A" 
    local gSerial = getPlayerSerial ( source ) 
    if ( serials [ gSerial ] ) then 
    outputChatBox("welcome mike",source) 
    else 
    if ( countries [gCountry] then 
    kickPlayer ( source, "Country not allowed." ) 
end 
end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), paises ) 

it doesnt kick him if serial doesnt match,and it doesnt kick him if hes from portugal without that serial

please help

Link to comment
still doesnt work

--ServerSide ,

local countries = 
    { 
        [ "PT" ] = true 
    } 
local serials = 
    { 
        [ "B1E80345047CC71F1F5C427C581C4D94" ] = true 
    } 
  
function paises ( ) 
    local gCountry = exports.admin:getPlayerCountry ( source ) or "N/A" 
    local gSerial = getPlayerSerial ( source ) 
    if ( serials [ gSerial ] ) then 
    outputChatBox("welcome mike",source) 
    elseif ( countries [gCountry]  ) then 
    kickPlayer ( source, "Country not allowed." ) 
end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), paises ) 

Make sure you add the resource in acl admin .

Link to comment
  • 1 year later...

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