getclosestplayer help
#5

The ProxDetector comes from the source of all evil, the gotfather code, dont use it

pawn Код:
forward Infect();
public Infect() //Need to be called with SetTimer
{ //Will infect players if they come in the range of 2.0 of an infected
    new
        j = -1,
        i = -1,
        Float:X,
        Float:Y,
        Float:Z,
        f = MAX_PLAYERS,
        sorted[MAX_PLAYERS];
    while((++i) != MAX_PLAYERS)
        if(Infected[i] == 0)
             sorted[++j] = i;
        else sorted[--f] = i;
    while((--f) != -1)
        if(GetPlayerPos(sorted[f], X, Y, Z))
            for(i = j; (++i) != MAX_PLAYERS; )
                if(IsPlayerInRangeOfPoint(sorted[i], 2.0, X, Y, Z))
                {
                    Infected[sorted[f]] = 1;
                    break;
                }
}
Reply


Messages In This Thread
getclosestplayer help - by WardenCS - 13.01.2011, 10:48
Re: getclosestplayer help - by Gratiz - 13.01.2011, 10:53
Re: getclosestplayer help - by WardenCS - 13.01.2011, 11:39
Re: getclosestplayer help - by WardenCS - 13.01.2011, 17:55
AW: getclosestplayer help - by Nero_3D - 14.01.2011, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)