13.10.2012, 17:25
Try using this but use your own variables / values
you will need to create the variable Open so use this
pawn Code:
if (strcmp("/gate", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1275.58, -1270.28, 14.32))
{
if(Open == false)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "The gate is now opening!");
MoveObject(gate, 1275.58, -1270.28, 4.32, 2.0);
Open = true;
return 1;
}
if(Open == true)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "The gate is now closing!");
MoveObject(gate, 1275.58, -1270.28, 14.32, 2.0);
Open = false;
return 1;
}
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "You are not near the impound lot!");
}
pawn Code:
new bool:Open;