24.09.2013, 15:28
Here's for the first one.
Just do the same for the second, and you'll be alright.
Auto gate with speed 3, and you need to be in range of 7 meters.
pawn Код:
#include <a_samp>
new FirstGate;
public OnGameModeInit()
{
FirstGate = CreateObject(980, 2497.20508, 2779.04443, 12.34830, 0.00000, 0.00000, 90.00000);
SetTimer("OpenGateAuto", 1000, 1);
}
forward OpenGateAuto();
public OpenGateAuto()
{
new open;
for(new i=GetMaxPlayers(); i > -1; i--)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 7.0, 2497.20508, 2779.04443, 12.34830))
{
open = 1;
MoveObject(FirstGate, 2497.20508, 2779.04443, 17.56272, 3.0);
break;
}
}
if(!open)
MoveObject(FirstGate, 2497.20508, 2779.04443, 12.34830, 3.0);
}
Auto gate with speed 3, and you need to be in range of 7 meters.