Skip to main content

SendingAttachmentsPrefs

Gets called when player is changing weapon attachments preferences.

Start a script section

!-- OnEvent SendingAttachmentsPrefs
-- require @evPlayer $evFirearmType $evOldAttachments $evNewAttachments $evIsAllowed

# Add your instructions here
  • Group: PlayerEvents
  • Cancellable: Yes
  • Event data: PlayerSendingAttachmentsPrefsEventArgs

Injected variables

VariableTypeDescription
@evPlayerplayer valueGets the player that invoked the event.
$evFirearmTypeItemType enum valueGets the ItemType of the firearm.
$evOldAttachmentsnumber valueGets previous attachments code stored on the server.
$evNewAttachmentsnumber valueGets or sets new attachments code. Edited values are NOT propagated back to the client and are stored on the server for on-spawn purposes.
$evIsAllowedbool valueWhether the event is allowed to run.