Requesting help regarding simple gate
#2

It isn't complicated, they just used a flag to see if the gate is opened or closed and executed the right code
pawn Код:
if(strcmp(cmdtext, "/gate", true) == 0) {
    static // local static variables hold their value after the function finished
        bool: gateOpened = false
    ;
    if(gateOpened) {
        // if its opened execute the closing code
        gateOpened = false;
    } else {
        // if it isn't opend execute the opening code
        gateOpened = true;
    }
}
Reply


Messages In This Thread
Requesting help regarding simple gate - by Arg - 17.08.2013, 23:46
AW: Requesting help regarding simple gate - by Nero_3D - 18.08.2013, 00:44
Re: Requesting help regarding simple gate - by Arg - 18.08.2013, 01:09

Forum Jump:


Users browsing this thread: 1 Guest(s)