SA-MP Forums Archive
/gate command help! - 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: /gate command help! (/showthread.php?tid=160006)



/gate command help! - phatlaced - 15.07.2010

Hi there, i want to know how to open and close a gate using the same command. At the moment im using /open and /close to activate the gate. Could someone please help? Thanks.


Re: /gate command help! - (SF)Noobanatior - 15.07.2010

just make a global varable say

new bool:gateopen;

then when the command runs check

if(gateopen) //close gate
else //open gate

and when it opens go: gateopen = true;
and when it closes go: gateopen = false;


chur chur


Re: /gate command help! - Correlli - 15.07.2010

Example by using the strcmp:

pawn Код:
new
        bool:gObjVar; // Global boolean variable.
pawn Код:
if(!strcmp(cmdtext, "/gate", true))
{
    if(gObjVar == false)
    {
        /* Open. */
        MoveObject(...);
        gObjVar = true;
    }
    else // It's true.
    {
        /* Close. */
        MoveObject(...);
        gObjVar = false;
    }
    return true;
}



Re: /gate command help! - willsuckformoney - 15.07.2010

Basically here, https://sampforum.blast.hk/showthread.php?tid=159604


Re: /gate command help! - (SF)Noobanatior - 15.07.2010

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
i think they mean gate will be open for 7 secs


Re: /gate command help! - willsuckformoney - 15.07.2010

lol auto close or not that link will help them, plus if he dont want auto close he can edit


Re: /gate command help! - phatlaced - 15.07.2010

Thanks everyone for your help. I used Correlli's way worked straight up, much appretiated