/// <summary> /// Add a clothes item from a slot and an index /// </summary> public bool AddClothes(ClothesSlot slot, int index) { Tuple <string, string> result = MtaShared.GetClothesByTypeIndex((int)slot, index); return(MtaShared.AddPedClothes(element, result.Item1, result.Item2, (int)slot)); }
/// <summary> /// Detach this attachable /// </summary> public void Detach() { MtaShared.DetachElements(element, null); }
/// <summary> /// Set the total ammo of a weapon the ped has /// </summary> public bool SetAmmo(SharedWeaponModel model, int totalAmmo, int ammoInClip = 0) { return(MtaShared.SetWeaponAmmo(element, model.ID, totalAmmo, ammoInClip)); }
/// <summary> /// Returns an array containing all accounts with specified dataName and value ( /// </summary> public static Account[] GetAccountsByData(string key, string value) { MtaAccount[] array = MtaShared.GetArrayFromTable(MtaServer.GetAccountsByData(key, value), "account"); return(CastMultiple(array)); }
/// <summary> /// This function is used to determine if this element is within a marker. /// </summary> public bool IsWithinMarker(SharedMarker marker) { return(MtaShared.IsElementWithinMarker(element, marker.MTAElement)); }
/// <summary> /// Ejects the ped from a vehicle /// </summary> public bool RemoveFromVehicle() { return(MtaShared.RemovePedFromVehicle(element)); }
/// <summary> /// Warp this ped into the driver seat of a vehicle /// </summary> public bool WarpIntoVehicle(SharedVehicle vehicle) { return(MtaShared.WarpPedIntoVehicle(element, vehicle.MTAElement, 0)); }
/// <summary> /// This function returns an integer that contains the ammo a specific weaponslot /// </summary> public int GetAmmoInClip(WeaponSlot slot) { return(MtaShared.GetPedAmmoInClip(element, (int)slot)); }
/// <summary> /// This function return the total ammo of a specific weaponslot /// </summary> public int GetTotalAmmo(WeaponSlot slot) { return(MtaShared.GetPedTotalAmmo(element, (int)slot)); }
/// <summary> /// Remove clothes from a certain slot /// </summary> public bool RemoveClothes(ClothesSlot slot) { return(MtaShared.RemovePedClothes(element, (int)slot, null, null)); }
/// <summary> /// Get the weapon in a specific slot /// </summary> public SharedWeaponModel GetWeaponInSlot(WeaponSlot slot) { return(new SharedWeaponModel(MtaShared.GetPedWeapon(element, (int)slot))); }
/// <summary> /// Get the current clothes texture of a slot /// </summary> public ClothesTexture GetClothesTexture(ClothesSlot slot) { Tuple <string, string> result = MtaShared.GetPedClothes(element, (int)slot); return((ClothesTexture)Enum.Parse(typeof(ClothesTexture), result.Item1)); }
/// <summary> /// Get the current clothes model of a slot /// </summary> public ClothesModel GetClothesModel(ClothesSlot slot) { Tuple <string, string> result = MtaShared.GetPedClothes(element, (int)slot); return((ClothesModel)Enum.Parse(typeof(ClothesModel), result.Item2)); }
/// <summary> /// Add clothes from only texture and model (does not work on tattoos) /// </summary> public bool AddClothes(ClothesTexture texture, ClothesModel model) { Tuple <int, int> result = MtaShared.GetTypeIndexFromClothes(texture.ToString(), model.ToString()); return(AddClothes((ClothesSlot)result.Item1, result.Item2)); }
/// <summary> /// Kill the ped, just providing a killer /// </summary> public bool Kill(SharedPed killer) { return(MtaShared.KillPed(element, killer.MTAElement, 255, 255, false)); }
/// <summary> /// Sets the animation of this ped /// </summary> public bool SetAnimation(Animation animation, bool loop = true, int time = -1, bool updatePosition = true, bool interruptable = true, bool freeLastFrame = true, int blendTime = 250) { return(MtaShared.SetPedAnimation(element, animation.Group, animation.Anim, time, loop, updatePosition, interruptable, freeLastFrame, blendTime)); }
/// <summary> /// Kill the ped without a killer /// </summary> public bool Kill() { return(MtaShared.KillPed(element, null, 255, 255, false)); }
/// <summary> /// Resets the animation back to normal /// </summary> public bool ResetAnimation() { return(MtaShared.SetPedAnimation(element, null, null, -1, true, true, true, true, 250)); }
/// <summary> /// Warp this ped into a vehicle, specifying a seat /// </summary> public bool WarpIntoVehicle(SharedVehicle vehicle, Seat seat) { return(MtaShared.WarpPedIntoVehicle(element, vehicle.MTAElement, (int)seat)); }
/// <summary> /// Sets the current animation progress of a player or ped. /// </summary> public bool SetAnimationProgress(Animation animation, float progress) { return(MtaShared.SetPedAnimationProgress(element, animation.Anim, progress)); }
/// <summary> /// Returns an array containing all accounts that were logged onto from specified IP-address. /// </summary> public static Account[] GetAccountsByIP(string ip) { MtaAccount[] array = MtaShared.GetArrayFromTable(MtaServer.GetAccountsByIP(ip), "account"); return(CastMultiple(array)); }
/// <summary> /// Sets the current animation speed of a player or ped. /// </summary> public bool SetAnimationSpeed(Animation animation, float speed = 1.0f) { return(MtaShared.SetPedAnimationSpeed(element, animation.Anim, speed)); }
/// <summary> /// This function is used to determine if an element is within a collision shape /// Please note that this function doesn't verify whether element is in the same dimension and interior, additional checks could be implemented manually if they are needed. /// </summary> public bool IsWithinCollisionShape(CollisionShape collisionShape) { return(MtaShared.IsElementWithinColShape(element, collisionShape.MTAElement)); }
/// <summary> /// Get the value of a specific stat /// </summary> public float GedStat(PedStat stat) { return(MtaShared.GetPedStat(element, (int)stat)); }
/// <summary> /// Attach this attachable to a toAttachable with 2 vectors describing a position offset and a rotation offset /// </summary> public void AttachTo(PhysicalElement toElement, Vector3 positionOffset, Vector3 rotationOffset) { MtaShared.AttachElements(element, toElement.MTAElement, positionOffset.X, positionOffset.Y, positionOffset.Z, rotationOffset.X, rotationOffset.Y, rotationOffset.Z); }
/// <summary> /// Set a specific stat on this ped /// </summary> public bool SetStat(PedStat stat, float value) { return(MtaShared.SetPedStat(element, (int)stat, value)); }
/// <summary> /// This function is used to retrieve an array of all elements of specified type within a range of 3D coordinates. /// </summary> public static PhysicalElement[] GetWithinRange(Vector3 position, float range, string type = "") { MtaElement[] mtaElements = MtaShared.GetArrayFromTable(MtaShared.GetElementsWithinRange(position.X, position.Y, position.Z, range, type), "MTAElement"); return(ElementManager.Instance.CastArray <PhysicalElement>(mtaElements)); }
/// <summary> /// Kill the ped with a killer, a weapon and a bodypart /// </summary> public bool Kill(SharedPed killer, SharedWeaponModel weapon, BodyPart bodyPart, bool stealth = false) { return(MtaShared.KillPed(element, killer.MTAElement, weapon.ID, (int)bodyPart, stealth)); }
public void WriteLine(string line, DebugMessageLevel level = DebugMessageLevel.Information) { MtaShared.OutputDebugString(line, (int)level, 255, 255, 255); }
/// <summary> /// Creates a pickup from all CreatePickup variables /// </summary> public Pickup(Vector3 position, PickupType type, int amount, int respawnTime = 30000, int ammo = 50) : this(MtaShared.CreatePickup(position.X, position.Y, position.Z, (int)type, amount, respawnTime, ammo)) { }