示例#1
0
 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;
 }
示例#3
0
 /// <summary>
 /// Morphs the pickup into a weapon pickup
 /// </summary>
 public bool Morph(SharedWeaponModel weapon, int ammo = 50)
 {
     return(Morph(PickupType.Weapon, weapon.ID, ammo));
 }
示例#4
0
 /// <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));
 }
示例#5
0
 /// <summary>
 /// Take a weapon from a player
 /// </summary>
 public bool TakeWeapon(SharedWeaponModel model)
 {
     return(MtaServer.TakeWeapon(element, model.ID, -1));
 }
示例#6
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));
 }
示例#7
0
 /// <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));
 }
示例#8
0
 /// <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))
 {
 }
示例#9
0
 /// <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));
 }
示例#10
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));
 }
示例#11
0
 /// <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)
 {
 }
示例#12
0
 /// <summary>
 /// Creates a weapon pickup
 /// </summary>
 public Pickup(Vector3 position, SharedWeaponModel weapon, int ammo = 50)
     : this(position, PickupType.Weapon, weapon.ID, 0, ammo)
 {
 }
示例#13
0
 internal OnWeaponSwitchEventArgs(dynamic previousWeapon, dynamic newWeapon)
 {
     PreviousWeapon = new SharedWeaponModel((int)previousWeapon);
     NewWeapon      = new SharedWeaponModel((int)newWeapon);
 }
示例#14
0
 internal OnChokeEventArgs(dynamic model, MtaElement ped)
 {
     WeaponModel    = new SharedWeaponModel((int)model);
     ResponsiblePed = ElementManager.Instance.GetElement <Ped>(ped);
 }