Extraer...
#1

Hay alguna manera de extraer la IP desde donde se esta iniciando el servidor ?
Reply
#2

pawn Код:
stock GetServerIP()
{
    static ip[16];
    GetConsoleVarAsString("bind", ip, sizeof(ip));
    return ip;
}
Agrega 'bind ***.***.***.***' a server.cfg y luego utiliza ese funcion.
Reply
#3

Cuando se inicia el servidor, en el log sale "Started server on ...", si tienes agregado "bind", sale la ip, sino solamente sale el puerto y el servidor se inicia en todas las direcciones de ip disponibles.
Reply
#4

PHP код:
#include <a_samp>
#include <a_http>
public OnFilterScriptInit() {
    
HTTP(0,HTTP_POST,"l2.io/ip"," ","ServerIP");
}
forward ServerIP(extraid,response_code,data[]);
public 
ServerIP(extraid,response_code,data[]) {
    
printf("El servidor ha iniciado en la IP %s:%d",data,GetServerVarAsInt("port"));

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)