Код:
I have a gate that opens/move when i go near it but then it doesnt close
Heres's script:
new gate;
forward InitPos();
public InitPos()
{
MoveObject(gate, 1033.4000200, 1180.6999500, 9.7000000, 4.0);
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 6.0,1027.4000200,1180.0999800,9.7000000))
{
MoveObject(gate, 1033.4000200, 1180.6999500, 9.7000000, 4.0);
SetTimer("InitPos",1000,true);
}
return 1;
}
gate = CreateObject(969,1027.4000200,1180.0999800,9.7000000,0.0000000,0.0000000,0.0000000); //object(electricgate) (1)
That's probably because both of your MoveObject functions are identical.
Try changing the MoveObject under InitPos to the same as your CreateObject one:
pawn Код:
//This would be the one under InitPos
MoveObject(gate, 969,1027.4000200,1180.0999800, 9.7000000, 4.0)