Command with two functions?
#1

Hi!

I'm wondering how to make a command with 2 functions, I've seen some servers with commands like /Maingate that opens & close the same gate or like /Textdraw shows the Textdraw but if you type it again, it hides the textdraw

How to do it? I'm using ZCMD

Thanks
Reply
#2

Variables.
Reply
#3

Can you give me an example?
Reply
#4

pawn Код:
new
    something
;

public OnGameModeInit( )
{
    something = 0; // 0 = closed
    return 1;
}

CMD:gates( playerid, params[ ] )
{
    if( something == 0 ) // if it's closed
    {
        // MoveObject( ... );
        something = 1; // 1 = opened
    }
    else // if it's opened
    {
        // MoveObject( ... );
        something = 0; // 0 = closed
    }
    return 1;
}
But in some cases, it's just for a certain playerid, so it should be with [ MAX_PLAYERS ] array.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)