Skip to content

Crumbs & debugging

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.

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.

CommandWhere
/bs_crumbsclientcrumbs of this session
/refreshuiclientclose every panel, drop NUI focus
/znet, /zsync, /zdiagserverzombie state, see Zombies
/znetc, /zgait, /zanim, /poolsclientzombie peds on your client, ped pool
/hotbardebuginventory hotbar
/prefsdebugserveradmin prefs
bsconfig_activeconsoleactive 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.

  • what you did, and what you expected
  • server console lines around it
  • F8 for client issues, crumbs for crashes
  • for zombies: /znet and /zsync output