DimaShift
Умник
команда что позволит проверять ваш сервер есть в хост таб или нет!
Код:
new bool:SererHostTab;
public OnGameModeInit()
{
SetTimer("ServerCheckHostTab",2000,0);
return 1;
}
forward ServerCheckHostTab();
public ServerCheckHostTab()
{
new str[70];
GetServerVarAsString("bind", str, sizeof(str)); // это функция только для версии 0.3.7 и выше.
format(str,sizeof(str),"monitor.sacnr.com/api/?IP=%s&Port=%i&Action=info",str,GetServerVarAsInt("port"));
HTTP(0, HTTP_GET, str, "", "HostTab");
}
forward HostTab(playerid, response, const data[]);
public HostTab(playerid, response, const data[])
{
if(strfind(data, "\"HostedTab\";s:1:\"1\"", true) != -1){
SererHostTab = true;
}else SererHostTab = false;
printf("Ваш сервер %sвлючен в HostTab!",SererHostTab == false?("не "):(""));//пишем результат в server_log
}
CMD:hosttab(playerid, params[])
{
new str[32];
format(str,sizeof(str),"Хост таб сервера %sвлючен!",SererHostTab == false?("не "):(""));
SendClientMessagef(playerid,-1,str);
return 1;
}
