Thanks for the advice. I've setup pretty much everything now, all I need to do is parse the numbers after each ',' character to retrieve current listeners, current bitrate and current song playing.
EDIT:
Finally, got everything working!
pawn Код:
forward StreamHttpResponse(playerid, response_code, data[]);
enum STREAMDATA
{
CURRENTLISTENERS,
STREAMSTATUS,
PEAKLISTENERS,
MAXLISTENERS,
UNIQUELISTENERS,
BITRATE,
SONGTITLE[32]
}
...
if(strcmp(cmd, "/radiostatus", true) == 0)
{
HTTP(playerid, HTTP_GET, "PHP SCRIPT THAT GRABS 7.HTML", "", "StreamHttpResponse");
return 1;
}
...
public StreamHttpResponse(playerid, response_code, data[])
{
new buffer[128];
if(response_code == 200)
{
new stream[STREAMDATA];
strdel(data, 0, 3);
sscanf(data, "p<,>e<iiiiiis[32]>", stream);
SendClientMessage(playerid, COLOR_RED, "Radio Status");
SendClientMessage(playerid, COLOR_RED, "============");
format(buffer, sizeof(buffer), "Listeners: %d of %d (at %dkbps)", stream[UNIQUELISTENERS], stream[MAXLISTENERS], stream[BITRATE]);
SendClientMessage(playerid, COLOR_GREEN, buffer);
format(buffer, sizeof(buffer), "Current Song: %s", stream[SONGTITLE]);
SendClientMessage(playerid, COLOR_GREEN, buffer);
}
else
{
SendClientMessage(playerid, COLOR_RED, "[Error] The radio must be down or there is a temporary error!");
}
}
Works flawlessly.