Timer 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)
+--- Thread: Timer help (
/showthread.php?tid=399261)
Timer help -
Riggster - 13.12.2012
Can anyone help me and show me how I would use a timer so this gate would shut after a certain lenth of time
MoveObject(pdgate, 1546.50000000, -1644.00000000, 15.19999981, 5); - open
MoveObject(pdgate, 1546.59997559, -1627.50000000, 15.19999981, 5); - closed
and can someone tell me how to put a pawno code box
Any help would be greatly appriciated
Re: Timer help -
David (Sabljak) - 13.12.2012
https://sampwiki.blast.hk/wiki/Automatic_Gates
It's easy
Re: Timer help -
DaRk_RaiN - 13.12.2012
Put this under OnGameModeInIt
pawn Код:
SetTimer("CloseNOpen",3000,1);//change the 3000 to the time you want the gate to close(1000 " 1 second which means the timer will check each 3 seconds if a player is near the gate.
Put this at the bottom of your script
pawn Код:
forward CloseNOpen();
public CloseNOpen)
{
for(new i=0;i<13;i++)
{
if((IsPlayerInRangeOfPoint(i,20,x, y, z) ))//Change 20 to the length you want the gate to get opened, then go to the object and replace the x y z with the object x y z (numbers)
{
MoveObject(pdgate, 1546.50000000, -1644.00000000, 15.19999981, 5);
}
else
{
MoveObject(pdgate, 1546.59997559, -1627.50000000, 15.19999981, 5);
}
}
}