12.11.2018, 07:50
PHP код:
forward UpdateMap(playerid, response_code, data[]);
public UpdateMap(playerid, response_code, data[])
{
new
string[ 1028 ];
if(response_code == 200)
{
format(string, sizeof(string), "%s", data);
printf("%s", string);
}
else
{
format(string, sizeof(string), "The request failed! The response code was: %d", response_code);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
public OnPlayerCommandText(playerid, cmdtext[]){
if(!strcmp(cmdtext, "/load")){
HTTP(playerid, HTTP_GET, "http://akibkhan.byethost7.com/maps.txt", "", "UpdateMap");
SendClientMessage(playerid, -1, "CMD Sent!");
return 1;
}
return 1;
}
PHP код:
http://akibkhan.byethost7.com/maps.txt