public Vendor GetClosestVendor()
{
// Find closest Vendor
Vendor ClosestVendor = ProfileManager.CurrentProfile.VendorManager.GetClosestVendor(Vendor.VendorType.Repair);
// Is there a vaild Vendor in the profile?
if (ClosestVendor == null)
{
// Log
slog("No Vendors defined in this Profile");
}
// Return object
return ClosestVendor;
}
public double GetVendorDistance(Vendor ClosestVendor)
{
// Variables
double ClosestVendorDistance = 0f;
// Is the Vendor valid?
if (ClosestVendor == null)
{
return -1;
}
else
{
ClosestVendorDistance = Me.Location.Distance(ClosestVendor.Location);
}
// Return distance
return ClosestVendorDistance;
}