03.05.2012, 15:48
Can't be bothered sorry, but here's my code for getting the closest player, it may be of some use:
pawn Code:
new Float:dist = FLOAT_INFINITY, closest_player = playerid;
new Float:pos[3], Float:this_dist;
foreach(new i : Player)
{
if(i == playerid) continue;
GetPlayerPos(i, pos[0], pos[1], pos[2]);
this_dist = GetPlayerDistanceFromPoint(playerid, pos[0], pos[1], pos[2]);
if(this_dist < dist)
{
closest_player = i;
dist = this_dist;
}
}