11.12.2011, 16:36
Will this work?
PHP код:
private bool IsPlayerInRangeOfPoint(Player pl, float radius, float X, float Y, float Z)
{
float px, py, pz;
px = pl.Pos.X;
py = pl.Pos.Y;
pz = pl.Pos.Z;
float dist = (((px - X) * (px - X)) + ((py - Y) * (py - Y)) + ((pz - Z) * (pz - Z)));
float radi = radius * radius;
if (dist >= radi)
{
return true;
}
else
{
return false;
}
}