Crumbs & debugging
Crumbs
Section titled “Crumbs”Client crashes in FiveM tell you almost nothing. Crumbs are the last things that happened before it, saved to KVP so they survive the crash.
Include it in your manifest:
client_script '@bs_core/shared/sh_crumbs.lua'and drop crumbs where things can go wrong:
Crumb('radiotower', 'spawn prop %s at %.1f %.1f', model, x, y)The string is only formatted when crumbs are on, so it’s cheap. Config in bs_core:
Config.Crumbs = { enabled = true, keep = 40, -- entries kept saveMs = 2000, -- KVP write interval}After a crash, the next start prints [crumbs] last session: in F8. /bs_crumbs prints the current session. Exports: Crumb(tag, msg), CrumbsOn(), Crumbs().
Good places for a crumb: before creating entities, loading models/anim dicts, attaching props, any native on an entity that might not exist anymore.
Logging
Section titled “Logging”bs_core has BS.Log.info/warn/error/debug(tag, msg), level from Config.Framework.logLevel. Inside other resources you don’t have BS.Log unless you include the framework, a plain print with the resource name is fine.
Commands worth knowing
Section titled “Commands worth knowing”| Command | Where | |
|---|---|---|
/bs_crumbs | client | crumbs of this session |
/refreshui | client | close every panel, drop NUI focus |
/znet, /zsync, /zdiag | server | zombie state, see Zombies |
/znetc, /zgait, /zanim, /pools | client | zombie peds on your client, ped pool |
/hotbardebug | inventory hotbar | |
/prefsdebug | server | admin prefs |
bsconfig_active | console | active F1 profile |
Plus the standard FiveM ones: resmon 1 and profiler record.
Many configs have a debug = false flag (Skills.Recoil.debug, Zombies.Net.debug, Guard.Settings.debug, Inventory.BodyRender.debug). Turn on the one you need, not all.
When you send a bug report
Section titled “When you send a bug report”- what you did, and what you expected
- server console lines around it
- F8 for client issues, crumbs for crashes
- for zombies:
/znetand/zsyncoutput
bs19.org · Privacy · Terms · Cookie settings