Class ShootingEventArgs
Contains all information before a player fires a weapon. ClaimedTarget and Player transform values are modified by PlayerRoles.FirstPersonControl.FpcBacktracker according to ShotBacktrackData sent by the Player and do not match the actual values.
public class ShootingEventArgs : IDeniableEvent, IFirearmEvent, IItemEvent, IPlayerEvent, IExiledEvent
- Inheritance
-
ShootingEventArgs
- Implements
- Inherited Members
- Extension Methods
Constructors
ShootingEventArgs(Firearm, ref ShotBacktrackData)
Initializes a new instance of the ShootingEventArgs class.
public ShootingEventArgs(Firearm firearm, ref ShotBacktrackData shotBacktrackData)
Parameters
firearm
FirearmThe InventorySystem.Items.Firearms.Firearm that is being fired.
shotBacktrackData
ShotBacktrackDataShotBacktrackData sent by the client.
Properties
ClaimedTarget
Gets the target that client claims it hit.
public Player ClaimedTarget { get; }
Property Value
Remarks
This value is controlled by the shooting player and should not be trusted. Can be null.
Direction
Gets or sets the exact direction of the shot before the bullet spread is applied.
public Vector3 Direction { get; set; }
Property Value
- Vector3
Firearm
Gets the firearm that is being fired.
public Firearm Firearm { get; }
Property Value
IsAllowed
Gets or sets a value indicating whether the shot can be fired.
public bool IsAllowed { get; set; }
Property Value
Item
Gets the Item triggering the event.
public Item Item { get; }
Property Value
Player
Gets the player who is shooting.
public Player Player { get; }
Property Value
ShotBacktrackData
Gets the ShotBacktrackData. This object contains the data sent by the client to the server.
public ShotBacktrackData ShotBacktrackData { get; }
Property Value
- ShotBacktrackData
Remarks
Values are controlled by the shooting player and should not be trusted.