New command, help.
#3

Should work, but that's not players within a sphere, that's players within a cube and is less efficient than the sphere check.
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);
}
But none-the-less it will work
Reply


Messages In This Thread
New command, help. - by Abernethy - 11.06.2009, 04:56
Re: New command, help. - by efeX - 11.06.2009, 05:30
Re: New command, help. - by Joe Staff - 11.06.2009, 06:06

Forum Jump:


Users browsing this thread: 4 Guest(s)