/gate command help!
#1

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.
Reply
#2

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
Reply
#3

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;
}
Reply
#4

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)