Код HTML:
#include <a_samp>
#include a_http
public OnFilterScriptInit()
{
HTTP(0,HTTP_GET,"www.oref.org.il/WarningMessages/alerts.json","","MyHttpResponse");
}
forward MyHttpResponse(index, response_code, data[]);
public MyHttpResponse(index, response_code, data[])
{
new buffer [ 128 ];
if(response_code == 200) //Dd the request succeed?i
{
printf("%s", data);
}
else
{
//No!
format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code);
print(buffer);
}
return HTTP(0,HTTP_GET,"www.oref.org.il/WarningMessages/alerts.json","","MyHttpResponse");
}
same..