02.10.2012, 19:28
Hey I'm creating moving gates for my LSPD faction and while it opens the gate properly, it does not close. To test whether or not it is working I added a client message in the code to close the gate however this does not appear in chat after the timer is finished here is the "gate" command:
And here is the timer:
pawn Код:
CMD:gate(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1540.59, -1627.57, 14.95))
{
if(PlayerInfo[playerid][Faction] == 1)
{
if(GateOpen == 0)
{
MoveObject(LSPDGate, 1540.59, -1607.57, 14.95, 2.0);
GateOpen = 1;
SetTimerEx("gateclose",10000,false,"i",playerid);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a member of the LSPD.");
}
}
return 1;
}
pawn Код:
public gateclose(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1540.59, -1627.57, 14.95))
{
MoveObject(LSPDGate, 1540.59, -1627.57, 14.95, 2.0);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "The gate is now closing!");
GateOpen = 0;
}
return 1;
}