SA-MP Forums Archive
Gate problems - 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: Gate problems (/showthread.php?tid=426542)



Gate problems - Branzy - 29.03.2013

Код:
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)



Re: Gate problems - MattyG - 29.03.2013

Quote:
Originally Posted by Branzy
Посмотреть сообщение
snip
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)