Timer help
#1

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
Reply
#2

https://sampwiki.blast.hk/wiki/Automatic_Gates

It's easy
Reply
#3

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);
}
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)