How to make when player type command one time to enable, second time to disable ?
#3

It's for ZCMD, I don't know what command processor you are using, but here's the main idea.

pawn Code:
new Enabled[MAX_PLAYERS];

CMD:duty(playerid,params[])
{
    if(Enabled[playerid] == 0)
    {
    Enabled[playerid] = 1;
    SendClientMessage(playerid,-1,"You are on duty now!");
    // rest of the code
    return 0; // return 0, so the code will ignore the other lines, allowing you to go on duty.
    }
    if(Enabled[playerid] == 1)
    {
    Enabled[playerid] = 0;
    SendClientMessage(playerid,-1,"You are now off duty!");
    //rest of code
    }
    return 1;
}
Reply


Messages In This Thread
How to make when player type command one time to enable, second time to disable ? - by bustern - 04.09.2013, 08:08
Re: How to make when player type command one time to enable, second time to disable ? - by QatarKnight - 04.09.2013, 08:19
Re: How to make when player type command one time to enable, second time to disable ? - by Tamer - 04.09.2013, 08:28
Re: How to make when player type command one time to enable, second time to disable ? - by QatarKnight - 04.09.2013, 08:35

Forum Jump:


Users browsing this thread: 1 Guest(s)