25.09.2012, 11:02
Well hello peoples, i made out this script to just try it and put it on my gamemode
But when i try the cmd, i get error code 6 or aka. HTTP_ERROR_MALFORMED_RESPONSE 6
I dont know how it comes, its only in-game, not in pawno, it dosnt tell me anything compiles fine. But ingame is the problem
pawn Код:
CMD:test(playerid, params[])
{
HTTP(playerid, HTTP_GET, "sagamerz.comli.com/test/sss.txt", "", "MyHttpResponse");
return 1;
}
forward MyHttpResponse(index, response_code, data[]);
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), "The URL replied: %s", data);
SendClientMessage(index, 0xFFFFFFFF, buffer);
}
else
{
//No!
format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code);
SendClientMessage(index, 0xFFFFFFFF, buffer);
}
}
I dont know how it comes, its only in-game, not in pawno, it dosnt tell me anything compiles fine. But ingame is the problem