11.06.2009, 06:06
Should work, but that's not players within a sphere, that's players within a cube and is less efficient than the sphere check.
But none-the-less it will work
pawn Код:
PlayerNearPlayer(player1,player2,Float:distance)
{
new Float:tmp[2][3];
GetPlayerPos(player1,tmp[0][0],tmp[0][1],tmp[0][2]);
GetPlayerPos(player2,tmp[1][0],tmp[1][1],tmp[1][2]);
return ((((tmp[1][0]-tmp[0][0])*(tmp[1][0]-tmp[0][0]))+((tmp[1][1]-tmp[0][1])*(tmp[1][1]-tmp[0][1]))+((tmp[1][2]-tmp[0][2])*(tmp[1][2]-tmp[0][2])))<distance*distance);
}