05.12.2012, 03:23
(
Последний раз редактировалось BreakDriFT; 05.12.2012 в 04:39.
)
pawn Код:
CMD:ler(playerid)
{
HTTP(playerid, HTTP_GET, "site.com/arquivo.txt", "", "MyHttpResponse");
return 1;
}
public MyHttpResponse(index, response_code, data[])
{
// In this callback "index" would normally be called "playerid" ( if you didn't get it already :) )
new
buffer[ 128 ];
if(response_code == 200) //Did the request succeed?
{
//Yes!
format(buffer, sizeof(buffer), "Dados recebidos: %s", data);
printf("%s",buffer);
}
else
{
//No!
format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code);
printf("%s",buffer);
}
}