06.02.2014, 14:43
So..I wanna this include to make it code that i can use directly in my GM.
Код:
#include <a_samp> #include <a_http> new _P_SERVERIP[20]; stock GetServerIP() return _P_SERVERIP; public OnGameModeInit() { HTTP(0,HTTP_GET,"www.ipchicken.com/","","OnServerGetIP"); return (funcidx("GSIP_OnGameModeInit") != -1)?CallLocalFunction("GSIP_OnGameModeInit",""):1; } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit GSIP_OnGameModeInit forward GSIP_OnGameModeInit(); forward OnServerGetIP(index, response_code, data[]); public OnServerGetIP(index, response_code, data[]) { if(response_code == 200) { strmid(_P_SERVERIP,data,1550,1570,1570); printf("Server IP is %s",_P_SERVERIP); } return 1; }