01.02.2012, 19:28
Hi guys i need some help! I've got a script about automatic gate! And it works but not fine!
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The Problem: When only me in the server it works fine, but someone came in , only the player who has id:1 and bigger id-s work and for id:0 doesn't work.
So if the server has xy players everyone work the gates except ID:0 player:S:S
What is the problem?:S
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The Problem: When only me in the server it works fine, but someone came in , only the player who has id:1 and bigger id-s work and for id:0 doesn't work.
So if the server has xy players everyone work the gates except ID:0 player:S:S
What is the problem?:S
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <foreach>
#include <zcmd>
#pragma tabsize 0
forward CheckGate();
new Gate1;
new Gate2;
public OnFilterScriptInit()
{
SetTimer("CheckGate", 1000, true);
CreateObject(966, 1328.35, -1385.73, 12.53, 0.0, 0.0, 0.0); // Gate1 talp
Gate1 = CreateObject(968, 1328.33, -1385.72, 13.25, 0.0, -90.0, 0.0);
CreateObject(966, 1722.78, 1611.90, 9.10, 0.00, 0.00, 70.20);
Gate2 = CreateObject(968, 1722.76, 1611.90, 9.88, 0.00, -90.00, 70.25);
print("\n--------------------------------------");
print(" Gates! ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public CheckGate()
{
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 5.00, 1325.0199,-1387.8572,13.6263))
{
if(IsPlayerInAnyVehicle(i))
{
MoveObject(Gate1, 1328.33, -1385.72, 13.25+0.0001, 0.0001, 0.0, 0.0, 0.0); //Nyilik
}
else
{
SendClientMessage(i, 0x00FF00AA, "You are not in any vehicle.");
}
}
else
{
MoveObject(Gate1, 1328.33, -1385.72, 13.25, 0.0001, 0.0, -90.0, 0.0); // Csukodik
}
if(IsPlayerInRangeOfPoint(i, 5.00, 1727.40, 1608.18, 8.91))
{
if(IsPlayerInAnyVehicle(i))
{
MoveObject(Gate2, 1722.76, 1611.90, 9.88+0.0001, 0.0001, 0.00, 0.00, 70.25); //Nyilik
}
else
{
SendClientMessage(i, 0x00FF00AA, "You are not in any vehicle.");
}
}
else
{
MoveObject(Gate2, 1722.76, 1611.90, 9.88, 0.0001, 0.00, -90.00, 70.25); // Csukodik
}
}
return 1;
}