What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Database Functions

protopally

Member
Joined
Jan 15, 2010
Messages
391
Reaction score
8
any chance of getting more Dbase fuctions like closestnpc by there faction? etc.

thanks
 
I wrote these some time ago for a questing plugin.

Change Vendor.VendorType.Repair to what ever Vendor.VendorType you need. This uses the Current Profiles <vendor> Vendor tag data.

Code:
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;
}
</vendor>
 
Last edited:
thanks mate i have somthing similar i want to be able to search the database though not the profile.
 
Back
Top