How to make gate commands
#1

Hello how to make gate commands that opens with same command and closes same command or better way it opens only with 1 or 2 persons i add names to command and it checks names if right name is in range it opens.

I am using that

if (strcmp("/oropen", cmdtext, true, 10) == 0)
{
MoveObject(hungate,3706.03491211,-1136.00903320,5.89200020,2);
return 1;
}

if (strcmp("/orclose", cmdtext, true, 10) == 0)
{
MoveObject(hungate,3706.03491211,-1136.00903320,5.89200020,2);
return 1;
}
Reply
#2

two are same X Y Z change that
Reply
#3

no i want other cmd not like thaat
Reply
#4

Are you asking for one command to do 2 things? Or do you need a timer so one command opens a gate for 'X' seconds and then closes the gate?
Reply
#5

Here is how.

pawn Код:
new GateState;
pawn Код:
COMMAND:gate(playerid, params[])
{
    {
        if(GateState == 1) //If gate is Open
        {
            GateState = 0; // Gate = Close
            MoveObject(ID_OF_YOUR_GATE,X,Y,Z,Speed); //Put replace x,y and z with the positions for the gate when it is closed
        }
        else
        {
            GateState = 1; //Gate = Open
            MoveObject(ID_OF_YOUR_GATE,X,Y,Z,Speed); //Put replace x,y and z with the positions for the gate when it is open
        }
    }
    return 1;
}
Reply
#6

thanks this is what i want.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)