CityRP Documentation Repository

bwep

Holstered weapon display (back, front, and optional hip pistols).

Functions

Sharedbwep.emptySlots() → table<integer, boolean|string>Source ☍

Returns a dense slot table filled with false.

Returns

  1. table<integer, boolean|string>
Sharedbwep.getSlotKind(slot) → stringSource ☍

Returns the kind of a 1-based holster slot.

Parameters

  • slotinteger

Returns

  1. string
Sharedbwep.isLongClass(class) → booleanSource ☍

Returns whether this class is a long gun for back/front slots.

Parameters

  • classstring

Returns

  1. boolean
Sharedbwep.isPistolClass(class) → booleanSource ☍

Returns whether this class is a holster pistol.

Parameters

  • classstring

Returns

  1. boolean
Sharedbwep.slotAccepts(slot, class) → booleanSource ☍

Returns whether a weapon class may occupy the given slot.

Parameters

  • slotinteger
  • classstring

Returns

  1. boolean
Sharedbwep.slotVisible(slot, showPistol) → booleanSource ☍

Returns whether a slot should appear in /weppos for the current pistol toggle. Hip slots are hidden until the player ticks "Show a pistol on my hip".

Parameters

  • slotinteger
  • showPistolboolean

Returns

  1. boolean

Tables

Sharedbwep.classByIndexSource ☍

Reverse lookup for net payloads: compact index -> class name.

Sharedbwep.classesSource ☍

Displayable weapon class -> compact net index. Long guns occupy 1-19 and 26 up; holster pistols 20-25. The grouping is only a convention for reading this table -- bwep.pistolClasses below is what decides which slots a class may use.

Sharedbwep.modelAttachmentsSource ☍
Sharedbwep.modelOffsetsSource ☍
Sharedbwep.offsetsSource ☍

Slots 1-5 are local to the chest attachment and 6-7 to the pelvis, but both frames are player aligned: -X is behind the body, +Y is the player's left, -Z is down. See bwep.getSlotAnchor.

Angles read the same way in either. Yaw 270 with roll 0 lays a gun flat against the back with its right flank facing out, and the pitch then swings the muzzle from the player's right (0) round to straight down (90) without lifting it off the body -- that is the family slots 4 and 5 sit in, shallow across the kidneys and steep across the shoulder blades respectively. Slots 6-7 hang a pistol muzzle down beside the leg, canted a few degrees so the grip leads the way a belt holster does.

Only slots 1-3 pose differently depending on what the player is holding. 4-7 declare Normal alone and drawPlayerWeapons falls back to it.

Sharedbwep.pistolClassesSource ☍

Pistol classes that may occupy hip holster slots.

Sharedbwep.pistolTypesSource ☍
Sharedbwep.rifleTypesSource ☍
Sharedbwep.slotIndexByIDSource ☍

Slot id -> index, so a slot can be named without depending on where it sits in the table or on the label players read.

Sharedbwep.slotsSource ☍

Ordered holster slots. The array index is the slot id sent over the net. id is what code refers to a slot by; name is only ever shown to players.

Fields

SharedbwepSource ☍
Sharedbwep.CLASS_BITSSource ☍

Bits used when writing a class index over the net. -1 means the slot is empty.

Sharedbwep.crouchingOffsetSource ☍
Sharedbwep.HIP_BONESource ☍

Bone the hip slots hang from. The chest attachment sits at the top of the spine, so a hip measured down from it is out by however long the torso of the player model happens to be, and drifts off the body the moment an animation moves the chest. The pelvis sits between the hip joints on every ValveBiped model and travels with the legs, which is what a belt holster does.

Sharedbwep.HIP_FALLBACKSource ☍

Chest-local drop to the hips, for a model with no pelvis bone to hang from.

Sharedbwep.HIP_LEFTSource ☍
Sharedbwep.HIP_RIGHTSource ☍
Sharedbwep.POS_BITSSource ☍

Bits used when writing a slot index over the net.

Sharedbwep.SLOT_COUNTSource ☍
Sharedbwep.SLOT_KIND_LONGSource ☍
Sharedbwep.SLOT_KIND_PISTOLSource ☍