Jump to content

Peticion Y Ayuda


SupraS

Recommended Posts

  • MTA Team

Esto como ejemplo kickearia cualquier jugador de Colombia o Brazil

  
function paises () 
local pais = exports.admin:getPlayerCountry (source) or "N/A" 
if pais == "CO" or pais == "BR" then 
kickPlayer(source,"Pais No Permitido") 
end 
end 
addEventHandler("onPlayerJoin", getRootElement(), paises) 

Recuerda que para que la función de kickPlayer funcione, debes agregarla al ACL de admin en el formato resource.[NOMBRE DEL RESOURCE]

Saludos.

Link to comment

Y si quisiera Agregar Más de dos paises Estaría bien así ? o como ?

function paises () 
local pais = exports.admin:getPlayerCountry (source) or "N/A" 
if pais == "CO" or pais == "BR" or pais == "CN" then 
kickPlayer(source,"Pais No Permitido") 
end 
end 
addEventHandler("onPlayerJoin", getRootElement(), paises) 

Link to comment
local countries = 
    { 
        [ "CO" ] = true, 
        [ "BR" ] = true, 
        [ "CN" ] = true 
    } 
  
function paises ( ) 
    local pais = exports.admin:getPlayerCountry ( source ) or "N/A" 
    if ( countries [ pais ] ) then 
        kickPlayer ( source, "Pais No Permitido" ) 
    end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), paises ) 

Con eso podes agregar mas paises facilmente.

Link to comment
  • MTA Team

@Solid tenias mal escrito countries en el IF. :)

  
local countries = 
    { 
        [ "CO" ] = true, 
        [ "BR" ] = true, 
        [ "CN" ] = true 
    } 
  
function paises ( ) 
    local pais = exports.admin:getPlayerCountry ( source ) or "N/A" 
    if ( countries [ pais ] ) then 
        kickPlayer ( source, "Pais No Permitido" ) 
    end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), paises ) 

Link to comment
  • 5 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...