Skip to content

bs_weapons

weapon attachments as real items, on a wheel.

Generated from the Lua sources in resources/[beyond]/bs_weapons/. 40 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:942The same list the server export gives, for anything client-side that needs to know what fits what - the staff menu builds its weapon rows from this.
ClientMagSizeclientclient/cl_main.lua:973lets bs_inventory cap ammo-box top-ups at the real mag size
FittedOnclientclient/cl_main.lua:960
Holsterclientclient/cl_holster.lua:157
IsHolsteredclientclient/cl_holster.lua:158
IsSuppressedclientclient/cl_main.lua:913IS THIS SHOT SILENT? A YES/NO, WHICH IS WHAT bs_emotes NEEDED AND HAD NO WAY TO ASK.
NameOfHashclientclient/cl_main.lua:264Hash -> weapon NAME, from the same table.
NoiseScaleclientclient/cl_main.lua:872bs_emotes broadcasts gunshots as noise; a suppressed weapon should broadcast a much smaller one.
OpenWheelclientclient/cl_main.lua:959
SyncedAmmoclientclient/cl_main.lua:237What the server last told us was left in this weapon.
SyncedAmmoByHashclientclient/cl_main.lua:253WHY THE SPAWN-RESTORE PATH STILL HANDED OVER 0 ROUNDS.
AttachmentsForserverserver/sv_main.lua:348WHAT FITS THIS WEAPON, AS ITEMS.
Fittedserverserver/sv_main.lua:340
MagInfoserverserver/sv_main.lua:272Everything a caller needs about a weapon’s ammo, in one place.
MagSizeserverserver/sv_main.lua:286
NoiseScaleserverserver/sv_main.lua:328
SavedAmmoserverserver/sv_main.lua:115
SetSavedAmmoserverserver/sv_main.lua:129SETTING the saved count, for the one caller that legitimately knows better than the client: an admin spawning a weapon to test with.

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:178
weapons:removeclient -> serverserver/sv_main.lua:210
weapons:returnAmmoclient -> serverserver/sv_main.lua:293After an extended mag comes off: rounds that no longer fit go back to the bag as whole boxes.
weapons:stateclient -> serverserver/sv_main.lua:164WHY THE COUNTS COME FROM HERE.

“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:67
bs:hook:player:spawnedclientlocalclient/cl_dryfire.lua:125
bs:hook:player:unloadedclientlocalclient/cl_holster.lua:153
bs:hook:player:unloadedserverlocalserver/sv_main.lua:76
bs:ui:openedclientlocalclient/cl_preview.lua:231If any other menu takes the screen, this camera has no business being up.
bs:weapons:forgetAllclientlocalclient/cl_main.lua:966An inventory wipe removed the guns from the ped (see bs_inventory’s bs:inventory:wiped handler).
bs:weapons:holdingIsservernetserver/sv_ammodebug.lua:125
bs:weapons:hotbarWeaponclientlocalclient/cl_holster.lua:142Pressing the quick-bar slot for the weapon ALREADY IN YOUR HANDS puts it away, rather than re-drawing the thing you are holding.
bs:weapons:reportAmmoservernetserver/sv_main.lua:98THE CLIENT REPORTING WHAT IS LEFT.
bs:weapons:syncclientnetclient/cl_main.lua:225WHY THIS NOW KEEPS THE SECOND ARGUMENT.
bs:weapons:whatAmIHoldingclientnetclient/cl_dryfire.lua:299The server asks what is actually in our hands, because it cannot see it reliably - GetSelectedPedWeapon is networked and lags a draw.
onResourceStopclientlocalclient/cl_magcheck.lua:247Nothing 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:84
CommandSideWhereDescription
/attachdebugclientclient/cl_main.lua:827
/bs_holsterclientclient/cl_holster.lua:131
/dryfireclientclient/cl_dryfire.lua:333This file has now been “fixed” three times, and twice the fix was correct while something upstream quietly prevented it from running.
/giveammoserverserver/sv_ammodebug.lua:97
/weaponinfoserverserver/sv_main.lua:370