04.01.2015, 16:54
Quote:
I prefixed most; I remember you giving me this tip on one of my last includes I've done. And how would you suggest hooking ServerInformation_Response? Thanks!
|
pawn Код:
forward ServerInformation_Response(index, response_code, data[]);
public ServerInformation_Response(index, response_code, data[])
{
if(response_code == 200)
{
if(strcmp(data, "Online", true) == 0)
{
ServerData[index][s_iOnline] = true;
return true;
}
else
{
ServerData[index][s_iOnline] = false;
}
printf("%s", data);
}
else printf("Unable to load server data(response code returned %d)", response_code);
#if defined iUServerInformation_Response
return iUServerInformation_Response(index, response_code, data);
#else
return 1;
#endif
}
#if defined _ALS_ServerInformation_Response
#undef ServerInformation_Response
#else
#define _ALS_ServerInformation_Response
#endif
#define ServerInformation_Response iUServerInformation_Response
#if defined iUServerInformation_Response
forward iUServerInformation_Response(index, response_code, data[]);
#endif
//So then, once if the data is received, they can check like:
public ServerInformation_Response(index, response_code, data[])
{
if(IsServerOnline(index))
{
print("It's online!");
}
else
print("It's not!");
}
return 1;
}