Gates
#5

I put this disclaimer on top...
Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
If you want to use an array, it could look like that
But you shouldnt use that code if you dont understand it
The array thing way easier to use if you understand how it works

----

If I compare your code and the code in the tutorial the open variable is missing
pawn Код:
public AutoTor() {
    new
        bool: openArmyGate1,
        bool: openArmyGate2
    ;
    for(new i; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            if(!openArmyGate1 && IsPlayerInRangeOfPoint( i, 15, 286.03, 1820.46, 19.94)) {
                openArmyGate1 = true;
            }
            else if(!openArmyGate2 && IsPlayerInRangeOfPoint( i, 15, 134.92, 1941.57, 21.64)) {
                openArmyGate2 = true;
            }
        }
    }
    if(openArmyGate1) {
        MoveObject(ArmyGate1, 286.03, 1833.72, 19.94, 3, 0.00, 0.00, 90.00);
    } else {
        MoveObject(ArmyGate1, 286.03, 1820.46, 19.94, 3, 0.00, 0.00, 90.00);
    }
    if(openArmyGate2) {
        MoveObject(ArmyGate2, 120.84, 1941.57, 21.62, 3, 0.00, 0.00, 0.00);
    } else {
        MoveObject(ArmyGate2, 134.92, 1941.57, 21.64, 3, 0.00, 0.00, 0.00);
    }
}
Reply


Messages In This Thread
Gates - by dalkgamler - 25.07.2012, 12:59
AW: Gates - by Nero_3D - 25.07.2012, 14:32
AW: Gates - by dalkgamler - 25.07.2012, 16:01
AW: Gates - by dalkgamler - 25.07.2012, 16:07
AW: Gates - by Nero_3D - 25.07.2012, 17:59
AW: Gates - by dalkgamler - 26.07.2012, 06:53
AW: Gates - by dalkgamler - 27.07.2012, 06:41
Re: Gates - by dowster - 27.07.2012, 06:51
AW: Gates - by dalkgamler - 27.07.2012, 06:53
AW: Gates - by dalkgamler - 27.07.2012, 07:24

Forum Jump:


Users browsing this thread: 1 Guest(s)