Command with two functions? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command with two functions? (
/showthread.php?tid=405643)
Command with two functions? -
mailu - 07.01.2013
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
Re: Command with two functions? -
Vince - 07.01.2013
Variables.
Re: Command with two functions? -
mailu - 07.01.2013
Can you give me an example?
Re: Command with two functions? -
Konstantinos - 07.01.2013
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.