06.03.2012, 17:23
Quote:
I want the /stopradio command to detect if the radio is off.
If the radio is off, I want It to send a client message saying "The radio is already turned off." |
You can use new variable like:-
pawn Код:
new IsRadioOn[MAX_PLAYERS];
pawn Код:
IsRadioOn[playerid] = 1; // on music command maybe
pawn Код:
if (strcmp("stopradio", cmdtext, true, 10) == 0)
{
if(IsRadioOn[playerid] == 1)
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_RED, "You have turned off the radio.");
IsRadioOn[playerid] = 0;
}
else
{
SendClientMessage(playerid, -1, "The radio is NOT on");
}
return 1;
}
Hope this helps

-FalconX