You need to do this. I'll rewrite the code for you.
pawn Код:
new radio[MAX_PLAYERS] = 0;
if (strcmp("/radiooff", cmdtext, true, 10) == 0)
{
if(radio[playerid] == 1)
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, white, "To turn the radio back on, do /radioon");
radio[playerid] = 0;
}
else if(radio[playerid] == 0)
{
SendClientMessage(playerid, white, "Your radio is already off!");
}
}
if (strcmp("/radioon", cmdtext, true, 10) == 0)
{
if(radio[playerid] == 0)
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283896");
SendClientMessage(playerid, white, "Your radio has been turned on. To turn it off, type /radiooff");
radio[playerid] = 1;
}
else if(radio[playerid] == 1)
{
SendClientMessage(playerid, white, "Your radio is already on, to turn it off, do /radiooff!");
}
}
You were making a global variable. That was your issue. Try using my code and tell me if it works or not.