SA-MP Forums Archive
How to make gate commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make gate commands (/showthread.php?tid=245049)



How to make gate commands - sMog. - 29.03.2011

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;
}


Re: How to make gate commands - Venice - 29.03.2011

two are same X Y Z change that


Re: How to make gate commands - sMog. - 29.03.2011

no i want other cmd not like thaat


Re: How to make gate commands - PCheriyan007 - 30.03.2011

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?


Re: How to make gate commands - Tee - 30.03.2011

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;
}



Re: How to make gate commands - sMog. - 30.03.2011

thanks this is what i want.