17.08.2012, 23:27
Heey all,
Is it possible to detect more then one(multiple) players that is in your distance like range 10?
Code:
How can i make that?
Thanks Admigo
Is it possible to detect more then one(multiple) players that is in your distance like range 10?
Code:
pawn Код:
public GetClosestPlayer(p1)
{
new Float:dis,Float:dis2,player;
player = -1;
dis = 99999.99;
foreach(Player,x)
{
if(x != p1)
{
dis2 = GetDistanceBetweenPlayers(x,p1);
if(dis2 < dis && dis2 != -1.00)
{
dis = dis2;
player = x;
}
}
}
return player;
}
Thanks Admigo