SupraS Posted January 22, 2014 Share Posted January 22, 2014 ¿Es posible prohibir a algunos paises que entren a mi servidor ? y como podria hacerlo ? Si me podrian ayudar Muchas Gracias Link to comment
Castillo Posted January 22, 2014 Share Posted January 22, 2014 Si es posible, podes usar la funcion exportada del admin panel de lil toady ( el que viene con el MTA ) getPlayerCountry para obtener el codigo de su pais. Link to comment
SupraS Posted January 23, 2014 Author Share Posted January 23, 2014 Y en que parte está eso ? Link to comment
SupraS Posted January 23, 2014 Author Share Posted January 23, 2014 ¿Y como podría Hacerlo para que Detecte 1 país específico? Link to comment
MTA Team 0xCiBeR Posted January 23, 2014 MTA Team Share Posted January 23, 2014 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
SupraS Posted January 23, 2014 Author Share Posted January 23, 2014 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
Castillo Posted January 23, 2014 Share Posted January 23, 2014 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 0xCiBeR Posted January 23, 2014 MTA Team Share Posted January 23, 2014 @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
Castillo Posted January 23, 2014 Share Posted January 23, 2014 Es verdad, fue un error al escribir rapido. Link to comment
SupraS Posted January 24, 2014 Author Share Posted January 24, 2014 Igual yo me habia dado cuenta del error, Gracias por tu ayuda Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 De nada. Link to comment
SupraS Posted July 1, 2014 Author Share Posted July 1, 2014 Ya no sirve este script ? que pasó Link to comment
Tomas Posted July 1, 2014 Share Posted July 1, 2014 Recuerda que debes tener activado el script 'admin' de lil_Toady. Link to comment
SupraS Posted July 3, 2014 Author Share Posted July 3, 2014 Sisi obvio pero no se que pasa Link to comment
UserToDelete Posted July 3, 2014 Share Posted July 3, 2014 Sisi obvio pero no se que pasa SI funciona, [testeado] Link to comment
Recommended Posts