10.02.2012, 07:13
Here is my moving gates (smoothly)
pawn Код:
#include <a_samp>
#pragma tabsize 0
new gate;
pawn Код:
public OnFilterScriptInit()
{
CreateObject(966, 1328.35, -1385.73, 12.53, 0.0, 0.0, 0.0);
SetTimer("GateCheck", 1000, true);
gate = CreateObject(968, 1328.33, -1385.72, 13.25, 0.0, -90.0, 0.0);
return 1;
}
pawn Код:
forward GateCheck();
public GateCheck()
{
for(new i; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
{
if(IsPlayerInAnyVehicle(i))
{
if(gateopen == false)
{
MoveObject(gate, 1328.33, -1385.72, 13.2501, 0.0001, 0.0, 0.0, 0.0); //IMPORTANT here we have add 0.0001 to the Z value THIS IS IMPORTANT
}
}
else
{
SendClientMessage(i, 0x00FF00AA, "You are not in any vehicle.");
}
return;
}
else
{
MoveObject(gate, 1328.33, -1385.72, 13.25, 0.0001, 0.0, -90.0, 0.0);
}
}