Automatic gates - bugged and taking much ressources
#10

Quote:
Originally Posted by ♣ ⓐⓢⓢ
I would suggest this way, its quite similar but a bit better cuz it uses bools and has an extra check in it

pawn Код:
public boobsgatetimer()
{
    new i = -1, bool:open[7];
    while(++i < MAX_PLAYERS)
    {
        if(boobsmember[i] == 1 || IsPlayerAdmin(i))
        {
            if(   !open[0] && IsPlayerInRangeOfPoint(i, 20, -545.30004882, 1251.15686035, 1.5))
                open[0] = true;
            else if(!open[1] && IsPlayerInRangeOfPoint(i, 5, -540.58142089, 1329.79467773, 3.28763198))
                open[1] = true;
        }
    }
    if(open[0])     MoveObject(boobsgate, -545.30004882, 1249.15686035, 9.5, 2);
    else            MoveObject(boobsgate, -545.30004882, 1251.15686035, 1.5, 2);
    if(open[1])     MoveObject(boobsdoor1, -540.58142089, 1329.79467773, 6.28763198, 2);
    else            MoveObject(boobsdoor1, -540.58142089, 1329.79467773, 3.28763198, 2);
}
Zamaroht, did you get active again ? Or missed I all your posts ?
The problem with this is that it will close regardless if the player is still standing near the gate, and wait a few seconds before opening again. So you'll end up with a opening/closing freaking once a player is nearby.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)