SA-MP Forums Archive
Auto Gates! Help! - 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: Auto Gates! Help! (/showthread.php?tid=92191)



Auto Gates! Help! - cozza123456 - 18.08.2009

Hi, I have auto gates which close when you are away from the doors, i wanted to change this to a 5 second timer then it shuts.
could somebody help on this?







Код:
    if (strcmp("/open", cmdtext, true, 10) == 0)
	{
		if(GatePos==0)
		{
		  if(PlayerToPoint(15.0, playerid, -2468.3889, 1547.0945, 23.8359))
  		{
     		MoveObject(cozgate, -2468.371338, 1547.240723, 24.030167, 2.0);
     		GatePos=1;
     		AreaTimer=SetTimerEx("Area",1,true,"d",playerid);
    	}
    	else
    	{
    	  SendClientMessage(playerid,0xFFFF00AA,"You are not near the gate!");
    	}
		}
		else
		{
		  if(PlayerToPoint(15.0, playerid, -2468.3889, 1547.0945, 23.8359))
  		{
     		MoveObject(cozgate, -2468.352051, 1547.224243, 21.280209, 2.0);
				GatePos=0;
     		KillTimer(AreaTimer);
    	}
    	else
    	{
    	  SendClientMessage(playerid,0xFFFF00AA,"You are not near the gate!");
    	}
		}
		return 1;
	}
could somebody please change this so its like i explained?


Re: Auto Gates! Help! - mamorunl - 18.08.2009

if it opens, add another timer of 5 seconds that shuts the gate