Quick question about a command.
#7

Quote:
Originally Posted by sniperwars
Посмотреть сообщение
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."
Well, that's exactly what I've written down, it should be like that:

pawn Код:
new bool:radio_on; /* You have to use this bool in an enum or anywhere else so you can also use it in /startradio. */

if (strcmp("/stopradio", cmdtext, true, 10) == 0)
{
    if(radio_on == TRUE)
    {
       StopAudioStreamForPlayer(playerid);
       SendClientMessage(playerid, COLOR_RED, "You have turned off the radio.");
       radio_on = FALSE;
       return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "The radio is already turned off.");
}
Reply


Messages In This Thread
Quick question about a command. - by sniperwars - 06.03.2012, 14:53
Re: Quick question about a command. - by GNGification - 06.03.2012, 15:19
Re: Quick question about a command. - by Campbell- - 06.03.2012, 16:27
Re: Quick question about a command. - by sniperwars - 06.03.2012, 16:35
Re: Quick question about a command. - by Campbell- - 06.03.2012, 16:49
Re: Quick question about a command. - by sniperwars - 06.03.2012, 17:15
Re: Quick question about a command. - by Campbell- - 06.03.2012, 17:22
Re: Quick question about a command. - by FalconX - 06.03.2012, 17:23
Re: Quick question about a command. - by sniperwars - 06.03.2012, 17:33
Re: Quick question about a command. - by FalconX - 06.03.2012, 17:34

Forum Jump:


Users browsing this thread: 3 Guest(s)