12.11.2012, 17:45
(
Последний раз редактировалось doreto; 13.11.2012 в 12:28.
)
I've try to use HTTP to retrive resolve host information about player but for some reason its show error: HTTP_ERROR_BAD_HOST 1
Thanks for everyone who help me solve this issue
pawn Код:
CMD:check4(playerid,params[])
{
new result[128];
//new ip[25] = "2.35.99.186";
new ip[25] = "84.54.177.51";
//new ip =GetPlayerIP(playerid);
format(result,sizeof(result), "linuxthefish.net?ip=%i.",ip);
HTTP(playerid, HTTP_GET, result, "", "MyHttpResponse");
return 1;
}
pawn Код:
forward MyHttpResponse(index, response_code, data[]);
public MyHttpResponse(index, response_code, data[])
{
new buffer[128];
if(response_code == 200)
{
format(buffer, sizeof(buffer), "%s", data);
SendClientMessage(index, -1, buffer);
}
else
{
format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code); // HTTP_ERROR_BAD_HOST 1
SendClientMessage(index, -1, buffer);
}
return 1;
}