25.02.2013, 17:57
I have the /opengate command which basically moves my custom placed gates.
If the player is NOT in range of the gates (12.0 radius), he gets a client message.
However, the player gets the client message EVEN if he is in the radius and the gate opens.
Who can spot the error for me? :/
If the player is NOT in range of the gates (12.0 radius), he gets a client message.
However, the player gets the client message EVEN if he is in the radius and the gate opens.
Who can spot the error for me? :/
pawn Код:
if(!strcmp(cmdtext,"/opengate",true))
{
if(gTeam[playerid] == NATIONALGUARD && IsPlayerInRangeOfPoint(playerid, 12.0, 96.76334, 1919.52905, 18.88980))
{
MoveObject(area51door1,96.76334, 1919.52905, 15.29157,2.0);
MoveObject(area51door2,96.73065, 1920.58228, 15.29157,2.0);
MoveObject(area51door3,96.75900, 1921.33777, 15.29157,2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate has been opened. Do not forget to close it.");
}
if(gTeam[playerid] == NATIONALGUARD && IsPlayerInRangeOfPoint(playerid, 12.0, 286.17056, 1949.13794, 19.27510))
{
MoveObject(area51slot1,286.17056, 1949.13794, 13.25867,1.5)
MoveObject(area51slot2,286.16769, 1963.24854, 13.27771,1.5);
SendClientMessage(playerid, COLOR_GREEN, "Gate has been opened. Do not forget to close it.");
}
if(gTeam[playerid] == NATIONALGUARD && IsPlayerInRangeOfPoint(playerid, 12.0, 344.67886, 1798.26257, 20.32330))
{
MoveObject(area51gate,344.67886, 1798.26257, 13.73979,2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate has been opened. Do not forget to close it.");
}
else SendClientMessage(playerid, COLOR_RED, "You are not close to any usable gate.");
return 1;
}