14.01.2011, 11:45
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;
}
}