How do I make something open and close with one command?
#3

Make a GLOBAL variable, like
pawn Код:
new DoorStatus;
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.
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;
        }
You'll get the idea
Reply


Messages In This Thread
How do I make something open and close with one command? - by Rabbayazza - 17.07.2012, 22:16
Re: How do I make something open and close with one command? - by Ironboy - 17.07.2012, 22:22
Re: How do I make something open and close with one command? - by Sandiel - 17.07.2012, 22:24
Re: How do I make something open and close with one command? - by ArmandoRamiraz - 17.07.2012, 22:28
Re: How do I make something open and close with one command? - by Rabbayazza - 17.07.2012, 22:41

Forum Jump:


Users browsing this thread: 1 Guest(s)