Get a random player in range of position using loops
#3

I know that goto is not very well handled by the compiler

You mean something like that ?
pawn Код:
stock GetRandomPlayerInRange(Float:X,Float:Y,Float:Z,Float:Range)
{
    new randPlayer;
    do {
        randPlayer = Iter_Random(Player);
        randPlayer = (IsPlayerInRangeOfPoint(randPlayer,Range,X,Y,Z) ? randPlayer : 255;
    }
    while (randPlayer == 255);
    return randPlayer;
}
Never ever used do-while loops
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)