17.07.2012, 22:24
(
Последний раз редактировалось Sandiel; 17.07.2012 в 22:25.
Причина: Fixed BB code :p
)
Make a GLOBAL variable, like
then change the command to check if this global variable equals to 1(door open) or 0 (door closed)
then just set the 1 and 0 to this one command, if you don't get it, I can do it for you.
You'll get the idea
pawn Код:
new DoorStatus;
then just set the 1 and 0 to this one command, if you don't get it, I can do it for you.
pawn Код:
public OnGameModeInit()
{
DoorStatus = 0;
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/door", true))
{
if(DoorStatus == 0) // checks if it is CLOSED
if(IsPlayerInRangeOfPoint(playerid, 10, 1410.19995117, -1650.09997559, 13.80000019))
{
MoveObject(GateOpen, 1410.09997559, -1650.09997559, 10.80000019, 3);
SendClientMessage(playerid, 0xEF994300, "You have opened the gate.");
}
if(IsPlayerInRangeOfPoint(playerid, 10, 955.70001221,-50.70000076,1002.00000000))
{
MoveObject(Door, 955.70001221,-50.59999847,998.20001221, 3);
}
else if(DoorStatus == 1) // checks if the door is OPEN
{
// close it here.
}
return 1;
}