/// <summary> /// Raises the <see cref="PlayerWeaponShot" /> event. /// </summary> /// <param name="player">The player triggering the event.</param> /// <param name="e">An <see cref="WeaponShotEventArgs" /> that contains the event data. </param> protected virtual void OnPlayerWeaponShot(GtaPlayer player, WeaponShotEventArgs e) { if (PlayerWeaponShot != null) PlayerWeaponShot(player, e); }
internal bool OnPlayerWeaponShot(int playerid, int weaponid, int hittype, int hitid, float fX, float fY, float fZ) { var args = new WeaponShotEventArgs((Weapon) weaponid, (BulletHitType) hittype, hitid, new Vector3(fX, fY, fZ)); OnPlayerWeaponShot(GtaPlayer.FindOrCreate(playerid), args); return !args.PreventDamage; }
/// <summary> /// Raises the <see cref="PlayerWeaponShot" /> event. /// </summary> /// <param name="player">The player triggering the event.</param> /// <param name="e">An <see cref="WeaponShotEventArgs" /> that contains the event data. </param> protected virtual void OnPlayerWeaponShot(BasePlayer player, WeaponShotEventArgs e) { PlayerWeaponShot?.Invoke(player, e); }