PHP код:
#include <a_samp>
#include <mxini>
#include <zcmd>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,748,DIALOG_STYLE_INPUT,"Enter radio id","Enter Id","Go","Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 748)
{
new donate;
new file = ini_openFile("radio.ini");
if(ini_getInteger(file, inputtext, donate) == 0)
{
new string[256];
format(string,sizeof(string),"[Radio]You start Radio ID:%s",inputtext);
new string2[256];
format(string2,sizeof(string2),"%s",donate);
PlayAudioStreamForPlayer(playerid, string2);
SendClientMessage(playerid,-1,string);
}
else
{
new string2[256];
format(string2,sizeof(string2),"[Radio]Invalid ID:%s",inputtext);
SendClientMessage(playerid,-1,string2);
}
iniClose(file);
}
return 1;
}