Skip to content

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.

Call with exports.bs_weapons:Name(...) from the same side.

NameSideWhereDescription
AttachmentsForclientclient/cl_main.lua:681Same list as the server export, for client code that needs to know what fits what (the staff menu uses it).
ClientMagSizeclientclient/cl_main.lua:728lets bs_inventory cap ammo-box top-ups at the real mag size
FittedOnclientclient/cl_main.lua:699
Holsterclientclient/cl_holster.lua:115
IsHolsteredclientclient/cl_holster.lua:116
IsSuppressedclientclient/cl_main.lua:654Is this shot silent? Yes/no for bs_emotes, which can only shrink a radius from NoiseScale.
NameOfHashclientclient/cl_main.lua:152Hash -> weapon name, from the same table.
NoiseScaleclientclient/cl_main.lua:638A suppressed weapon broadcasts a much smaller gunshot noise to bs_emotes.
OpenWheelclientclient/cl_main.lua:698
SyncedAmmoclientclient/cl_main.lua:143What the server last told us was left in this weapon.
SyncedAmmoByHashclientclient/cl_main.lua:146SyncedAmmo is keyed by weapon name, but the spawn-restore path stores a numeric hash, so the lookup could never match.
AttachmentsForserverserver/sv_main.lua:410Attachments that fit a weapon, as items, for the staff menu.
Fittedserverserver/sv_main.lua:407
MagInfoserverserver/sv_main.lua:346Ammo info for a weapon (name or hash).
MagSizeserverserver/sv_main.lua:360
NoiseScaleserverserver/sv_main.lua:396
SavedAmmoserverserver/sv_main.lua:183
SetActiveserverserver/sv_main.lua:233bs_inventory calls this when a weapon item is drawn (use or hotbar), so the right gun’s parts are used.
SetSavedAmmoserverserver/sv_main.lua:186Sets the saved ammo count.

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, ...).

NameDirectionWhereDescription
weapons:fitclient -> serverserver/sv_main.lua:254
weapons:fittedclient -> serverserver/sv_main.lua:227Cheap version for the client’s weapon-change refit: just what is on the gun in hand.
weapons:removeclient -> serverserver/sv_main.lua:288
weapons:returnAmmoclient -> serverserver/sv_main.lua:366After an extended mag comes off, rounds that no longer fit go back to the bag as whole boxes.
weapons:stateclient -> serverserver/sv_main.lua:212Attachment counts come from the server.

“net” means the handler is registered with RegisterNetEvent, so the other side can trigger it. “local” is AddEventHandler only (same side, or game events).

NameSideTypeWhereDescription
bs:hook:player:loadedserverlocalserver/sv_main.lua:138
bs:hook:player:spawnedclientlocalclient/cl_dryfire.lua:29
bs:hook:player:unloadedclientlocalclient/cl_holster.lua:111
bs:hook:player:unloadedserverlocalserver/sv_main.lua:148
bs:ui:openedclientlocalclient/cl_preview.lua:172If any other menu takes the screen, this camera comes down.
bs:weapons:bagChangedclientlocalclient/cl_main.lua:711
bs:weapons:forgetclientlocalclient/cl_main.lua:703An inventory wipe removed the guns from the ped.
bs:weapons:forgetAllclientlocalclient/cl_main.lua:721
bs:weapons:holdingIsservernetserver/sv_ammodebug.lua:74
bs:weapons:hotbarWeaponclientlocalclient/cl_holster.lua:100Pressing the slot of the weapon already in hand puts it away instead of re-drawing it.
bs:weapons:reportAmmoservernetserver/sv_main.lua:166Ammo lives on the ped (client only), so the client reports it.
bs:weapons:syncclientnetclient/cl_main.lua:131Keep the ammo argument the server sends with set, so the spawn-restore path can look up the saved round count.
bs:weapons:whatAmIHoldingclientnetclient/cl_dryfire.lua:115The server asks what is in our hands because GetSelectedPedWeapon is networked and lags a draw (see server/sv_ammodebug.lua).
onResourceStopclientlocalclient/cl_magcheck.lua:155Nothing 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.
playerDroppedserverlocalserver/sv_main.lua:157
CommandSideWhereDescription
/attachdebugclientclient/cl_main.lua:597
/bs_holsterclientclient/cl_holster.lua:92
/dryfireclientclient/cl_dryfire.lua:135Prints every input the restore decision uses, one line each, so a failure can be diagnosed with one command.
/giveammoserverserver/sv_ammodebug.lua:48
/weaponinfoserverserver/sv_main.lua:432