bs_weapons
weapon attachments as real items, on a wheel.
Generated from the Lua sources in resources/[beyond]/bs_weapons/. 44 entries. The description column is the comment above the line in the code, so if it’s empty nobody wrote one yet.
Exports
Section titled “Exports”Call with exports.bs_weapons:Name(...) from the same side.
| Name | Side | Where | Description |
|---|---|---|---|
AttachmentsFor | client | client/cl_main.lua:681 | Same list as the server export, for client code that needs to know what fits what (the staff menu uses it). |
ClientMagSize | client | client/cl_main.lua:728 | lets bs_inventory cap ammo-box top-ups at the real mag size |
FittedOn | client | client/cl_main.lua:699 | |
Holster | client | client/cl_holster.lua:115 | |
IsHolstered | client | client/cl_holster.lua:116 | |
IsSuppressed | client | client/cl_main.lua:654 | Is this shot silent? Yes/no for bs_emotes, which can only shrink a radius from NoiseScale. |
NameOfHash | client | client/cl_main.lua:152 | Hash -> weapon name, from the same table. |
NoiseScale | client | client/cl_main.lua:638 | A suppressed weapon broadcasts a much smaller gunshot noise to bs_emotes. |
OpenWheel | client | client/cl_main.lua:698 | |
SyncedAmmo | client | client/cl_main.lua:143 | What the server last told us was left in this weapon. |
SyncedAmmoByHash | client | client/cl_main.lua:146 | SyncedAmmo is keyed by weapon name, but the spawn-restore path stores a numeric hash, so the lookup could never match. |
AttachmentsFor | server | server/sv_main.lua:410 | Attachments that fit a weapon, as items, for the staff menu. |
Fitted | server | server/sv_main.lua:407 | |
MagInfo | server | server/sv_main.lua:346 | Ammo info for a weapon (name or hash). |
MagSize | server | server/sv_main.lua:360 | |
NoiseScale | server | server/sv_main.lua:396 | |
SavedAmmo | server | server/sv_main.lua:183 | |
SetActive | server | server/sv_main.lua:233 | bs_inventory calls this when a weapon item is drawn (use or hotbar), so the right gun’s parts are used. |
SetSavedAmmo | server | server/sv_main.lua:186 | Sets the saved ammo count. |
Callbacks
Section titled “Callbacks”Server callbacks are called from a client with BSB.Await(name, timeoutMs, ...). Client callbacks are called from the server with BSB.AwaitClient(src, name, timeoutMs, ...).
| Name | Direction | Where | Description |
|---|---|---|---|
weapons:fit | client -> server | server/sv_main.lua:254 | |
weapons:fitted | client -> server | server/sv_main.lua:227 | Cheap version for the client’s weapon-change refit: just what is on the gun in hand. |
weapons:remove | client -> server | server/sv_main.lua:288 | |
weapons:returnAmmo | client -> server | server/sv_main.lua:366 | After an extended mag comes off, rounds that no longer fit go back to the bag as whole boxes. |
weapons:state | client -> server | server/sv_main.lua:212 | Attachment counts come from the server. |
Events
Section titled “Events”“net” means the handler is registered with RegisterNetEvent, so the other side can trigger it. “local” is AddEventHandler only (same side, or game events).
| Name | Side | Type | Where | Description |
|---|---|---|---|---|
bs:hook:player:loaded | server | local | server/sv_main.lua:138 | |
bs:hook:player:spawned | client | local | client/cl_dryfire.lua:29 | |
bs:hook:player:unloaded | client | local | client/cl_holster.lua:111 | |
bs:hook:player:unloaded | server | local | server/sv_main.lua:148 | |
bs:ui:opened | client | local | client/cl_preview.lua:172 | If any other menu takes the screen, this camera comes down. |
bs:weapons:bagChanged | client | local | client/cl_main.lua:711 | |
bs:weapons:forget | client | local | client/cl_main.lua:703 | An inventory wipe removed the guns from the ped. |
bs:weapons:forgetAll | client | local | client/cl_main.lua:721 | |
bs:weapons:holdingIs | server | net | server/sv_ammodebug.lua:74 | |
bs:weapons:hotbarWeapon | client | local | client/cl_holster.lua:100 | Pressing the slot of the weapon already in hand puts it away instead of re-drawing it. |
bs:weapons:reportAmmo | server | net | server/sv_main.lua:166 | Ammo lives on the ped (client only), so the client reports it. |
bs:weapons:sync | client | net | client/cl_main.lua:131 | Keep the ammo argument the server sends with set, so the spawn-restore path can look up the saved round count. |
bs:weapons:whatAmIHolding | client | net | client/cl_dryfire.lua:115 | The server asks what is in our hands because GetSelectedPedWeapon is networked and lags a draw (see server/sv_ammodebug.lua). |
onResourceStop | client | local | client/cl_magcheck.lua:155 | Nothing should be left mid-animation by a restart or a death - both stop the clip, but neither clears the flag, and a stuck flag means SHIFT+R never works again for that session. |
playerDropped | server | local | server/sv_main.lua:157 |
Commands
Section titled “Commands”| Command | Side | Where | Description |
|---|---|---|---|
/attachdebug | client | client/cl_main.lua:597 | |
/bs_holster | client | client/cl_holster.lua:92 | |
/dryfire | client | client/cl_dryfire.lua:135 | Prints every input the restore decision uses, one line each, so a failure can be diagnosed with one command. |
/giveammo | server | server/sv_ammodebug.lua:48 | |
/weaponinfo | server | server/sv_main.lua:432 |
bs19.org · Privacy · Terms · Cookie settings
Cookies and outside content
The site only needs two essential cookies to keep you logged in and protect forms. Videos and streams from YouTube and Twitch load from their servers, which can set their own cookies, so they stay off until you say yes. Nothing is pre-ticked and you can change your mind any time with "Cookie settings" at the bottom of every page. Details.
Questions about the server, the framework or the site? A real person reads this, usually within a day.