29.01.2011, 15:57
Hello, I need help with a gate script.. it compiles fine, no error... but when I go ingame and type the command nothing happens!
What's wrong with it?
Thanks..
What's wrong with it?
pawn Код:
if(strcmp(cmd, "/go", true) == 0)
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15,1544.6055,-1627.2274,13.3828))
{
if(lspdgate1 == 0)
{
MoveObject(lspdgate1,1544.5834960938, -1626.9783935547, 11.065950393677,0.8);
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[GATE:] Gate is opening!");
lspdgate1 = 1;
}
else if(lspdgate1 == 1)
{
MoveObject(lspdgate1,1544.5834960938, -1626.9783935547, 13.051549911499,0.8);
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[GATE:] Gate is closing!");
lspdgate1 = 0;
}
}
else if(IsPlayerInRangeOfPoint(playerid, 15,1588.2606,-1637.9075,13.4260))
{
if(lspdgate2 == 0)
{
MoveObject(lspdgate2,1544.5834960938, -1626.9783935547, 11.065950393677,0.8);
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[GATE:] Gate is opening!");
lspdgate2 = 1;
}
else if(lspdgate2 == 1)
{
MoveObject(lspdgate2,1544.5834960938, -1626.9783935547, 13.051549911499,0.8);
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[GATE:] Gate is closing!");
lspdgate2 = 0;
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[ERROR:] You are not near a gate!");
}
}
else
{
SendClientMessage(playerid,COLOR_LIGHTYELLOW2, "[ERROR:] You are not a member of the required faction/type.");
}
return 1;
}