26.08.2014, 19:16
I'm assuming you never tried the search bar...
pawn Код:
GetClosestPlayer( toplayer, Float:range )
{
new Float:tpos[ 3 ], targetid = INVALID_PLAYER_ID;
GetPlayerPos( toplayer, tpos[ 0 ], tpos[ 1 ], tpos[ 2 ] );
foreach( Player, i )
{
if( IsPlayerInRangeOfPoint( i, range, tpos[ 0 ], tpos[ 1 ], tpos[ 2 ] ) )
targetid = i;
}
return targetid;
}