SA-MP Forums Archive
Making a command do two different thinks? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Making a command do two different thinks? (/showthread.php?tid=86579)



Making a command do two different thinks? - Devine - 15.07.2009

I want to make my /door, /gates and /barrier commands both open and close. So like if someone goes up to the gates and do /gates, they open the gates, but when they do /gates again it shuts the gate? i also want to do this for /engine. Please help.


Re: Making a command do two different thinks? - arnutisz - 15.07.2009

Create new variable, like "new gatesopen;" and then check is gates opened or not:
pawn Код:
if(gatesopened == 0)
{
   //Open your gates
  gatesopened = 1;
}
else if(gatesopened == 1)
{
   //close your gates
  gatesopened = 0;
}