Esempio n. 1
0
        /// <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));
        }
Esempio n. 2
0
 /// <summary>
 /// Detach this attachable
 /// </summary>
 public void Detach()
 {
     MtaShared.DetachElements(element, null);
 }
Esempio n. 3
0
 /// <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));
 }
Esempio n. 4
0
 /// <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));
 }
Esempio n. 5
0
 /// <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));
 }
Esempio n. 6
0
 /// <summary>
 /// Ejects the ped from a vehicle
 /// </summary>
 public bool RemoveFromVehicle()
 {
     return(MtaShared.RemovePedFromVehicle(element));
 }
Esempio n. 7
0
 /// <summary>
 /// Warp this ped into the driver seat of a vehicle
 /// </summary>
 public bool WarpIntoVehicle(SharedVehicle vehicle)
 {
     return(MtaShared.WarpPedIntoVehicle(element, vehicle.MTAElement, 0));
 }
Esempio n. 8
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));
 }
Esempio n. 9
0
 /// <summary>
 /// This function return the total ammo of a specific weaponslot
 /// </summary>
 public int GetTotalAmmo(WeaponSlot slot)
 {
     return(MtaShared.GetPedTotalAmmo(element, (int)slot));
 }
Esempio n. 10
0
 /// <summary>
 /// Remove clothes from a certain slot
 /// </summary>
 public bool RemoveClothes(ClothesSlot slot)
 {
     return(MtaShared.RemovePedClothes(element, (int)slot, null, null));
 }
Esempio n. 11
0
 /// <summary>
 /// Get the weapon in a specific slot
 /// </summary>
 public SharedWeaponModel GetWeaponInSlot(WeaponSlot slot)
 {
     return(new SharedWeaponModel(MtaShared.GetPedWeapon(element, (int)slot)));
 }
Esempio n. 12
0
        /// <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));
        }
Esempio n. 13
0
        /// <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));
        }
Esempio n. 14
0
        /// <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));
        }
Esempio n. 15
0
 /// <summary>
 /// Kill the ped, just providing a killer
 /// </summary>
 public bool Kill(SharedPed killer)
 {
     return(MtaShared.KillPed(element, killer.MTAElement, 255, 255, false));
 }
Esempio n. 16
0
 /// <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));
 }
Esempio n. 17
0
 /// <summary>
 /// Kill the ped without a killer
 /// </summary>
 public bool Kill()
 {
     return(MtaShared.KillPed(element, null, 255, 255, false));
 }
Esempio n. 18
0
 /// <summary>
 /// Resets the animation back to normal
 /// </summary>
 public bool ResetAnimation()
 {
     return(MtaShared.SetPedAnimation(element, null, null, -1, true, true, true, true, 250));
 }
Esempio n. 19
0
 /// <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));
 }
Esempio n. 20
0
 /// <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));
 }
Esempio n. 21
0
 /// <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));
 }
Esempio n. 22
0
 /// <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));
 }
Esempio n. 23
0
 /// <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));
 }
Esempio n. 24
0
 /// <summary>
 /// Get the value of a specific stat
 /// </summary>
 public float GedStat(PedStat stat)
 {
     return(MtaShared.GetPedStat(element, (int)stat));
 }
Esempio n. 25
0
 /// <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);
 }
Esempio n. 26
0
 /// <summary>
 /// Set a specific stat on this ped
 /// </summary>
 public bool SetStat(PedStat stat, float value)
 {
     return(MtaShared.SetPedStat(element, (int)stat, value));
 }
Esempio n. 27
0
 /// <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));
 }
Esempio n. 28
0
 /// <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));
 }
Esempio n. 29
0
 public void WriteLine(string line, DebugMessageLevel level = DebugMessageLevel.Information)
 {
     MtaShared.OutputDebugString(line, (int)level, 255, 255, 255);
 }
Esempio n. 30
0
 /// <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))
 {
 }