internal OnWeaponFireEventArgs(dynamic weapon, dynamic ammoLeft, dynamic ammoLeftInClip, dynamic ex, dynamic ey, dynamic ez, MtaElement hitElement) { Weapon = new SharedWeaponModel((int)weapon); HitElement = ElementManager.Instance.GetElement <PhysicalElement>(hitElement); HitPosition = new Vector3((float)ex, (float)ey, (float)ez); AmmoLeft = (int)ammoLeft; AmmoLeftInClip = (int)ammoLeftInClip; }
internal OnDamageEventArgs(MtaElement attacker, dynamic weaponModel, dynamic loss, dynamic x, dynamic y, dynamic z, dynamic damagedTire) { Attacker = ElementManager.Instance.GetElement <PhysicalElement>(attacker); Weapon = new SharedWeaponModel((int)weaponModel); Loss = (float)loss; Position = new Vector3((float)x, (float)y, (float)z); Tire = (Tire)damagedTire; }
/// <summary> /// Morphs the pickup into a weapon pickup /// </summary> public bool Morph(SharedWeaponModel weapon, int ammo = 50) { return(Morph(PickupType.Weapon, weapon.ID, ammo)); }
/// <summary> /// Take a certain amount of ammo from a player weapon /// </summary> public bool TakeAmmo(SharedWeaponModel model, int amount) { return(MtaServer.TakeWeapon(element, model.ID, amount)); }
/// <summary> /// Take a weapon from a player /// </summary> public bool TakeWeapon(SharedWeaponModel model) { return(MtaServer.TakeWeapon(element, model.ID, -1)); }
/// <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> /// Give a weapon to this ped /// </summary> public bool GiveWeapon(SharedWeaponModel model, int ammo = 30, bool setAsCurrent = false) { return(MtaServer.GiveWeapon(element, model.ID, ammo, setAsCurrent)); }
/// <summary> /// Create a custom weapon at a certain position /// </summary> public CustomWeapon(SharedWeaponModel model, Vector3 position) : this(MtaClient.CreateWeapon(model.Name, position.X, position.Y, position.Z)) { }
/// <summary> /// Gives a weapon to this ped /// </summary> public bool GiveWeapon(SharedWeaponModel weapon, int ammo = 30, bool setAsCurrent = false) { return(MtaClient.GivePedWeapon(element, weapon.ID, ammo, setAsCurrent)); }
/// <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)); }
/// <summary> /// Creates a weapon pickup /// </summary> public Pickup(Vector3 position, SharedWeaponModel weapon, int ammo = 50, int respawnTime = 30000) : this(position, PickupType.Weapon, weapon.ID, respawnTime, ammo) { }
/// <summary> /// Creates a weapon pickup /// </summary> public Pickup(Vector3 position, SharedWeaponModel weapon, int ammo = 50) : this(position, PickupType.Weapon, weapon.ID, 0, ammo) { }
internal OnWeaponSwitchEventArgs(dynamic previousWeapon, dynamic newWeapon) { PreviousWeapon = new SharedWeaponModel((int)previousWeapon); NewWeapon = new SharedWeaponModel((int)newWeapon); }
internal OnChokeEventArgs(dynamic model, MtaElement ped) { WeaponModel = new SharedWeaponModel((int)model); ResponsiblePed = ElementManager.Instance.GetElement <Ped>(ped); }