pawno (filterscript)
Код:
#include <a_samp>
forward CheckGate();
new Gate1;
public OnFilterScriptInit()
{
SetTimer("CheckGate", 1000, true);
CreateObject(966, 1328.74, -1385.46, 12.69, 0.00, 0.00, 0.00); // Gate1 talp
Gate1 = CreateObject(968, 1328.74, -1385.45, 13.47, 1.92, -90.30, 0.00);
print("\n--------------------------------------");
print(" Gates! ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public CheckGate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
{
MoveObject(Gate1, 1328.74, -1385.45, 15.98, 3);
}
else
{
MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3);
}
}
}
}
Its WOrking well! But if i Change only the Rotation values the gate will be move suddenly at the position not smoothly :S
for example
Код:
#include <a_samp>
forward CheckGate();
new Gate1;
public OnFilterScriptInit()
{
SetTimer("CheckGate", 1000, true);
CreateObject(966, 1328.74, -1385.46, 12.69, 0.00, 0.00, 0.00); // Gate1 talp
Gate1 = CreateObject(968, 1328.74, -1385.45, 13.47, 1.92, -90.30, 0.00);
print("\n--------------------------------------");
print(" Gates! ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public CheckGate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
{
MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3,0.00,-90.0,-4.0); // i edited only the [Y] and [Z] rotation value
}
else
{
MoveObject(Gate1, 1328.74, -1385.45, 13.47, 3,0.00,0.00,0.00);
}
}
}
}