public float CalculateDistance(Vector Pos1, Vector Pos2)
{
float dx = Pos2.X - Pos1.X;
float dy = Pos2.Y - Pos1.Y;
float dz = Pos2.Z - Pos1.Z;
return (float)Math.Sqrt(dx * dx + dy * dy + dz * dz);
}
注意:传入参数Vector的namespace为CounterStrikeSharp.API.Modules.Utils