mri-fivem-skills
All skills

mri-resource-check

Checking a resource

Checks a FiveM resource before calling a change done and looks up natives instead of guessing.

Nothing is "done" until it parsed, loaded and was read end to end. Say what was verified where (parser, server log, client log, browser, game) and what was not tested.

0. Natives: look up, never guess

Before writing a native, confirm its name, parameters and side:

node scripts/natives.mjs SetEntityHeading     # signature, client/server, docs link
node scripts/natives.mjs vehicle door         # every native with these words

Data: the official Cfx lists (static.cfx.re/natives/natives.json and natives_cfx.json), downloaded on first use and cached for a week in the system temp folder. Data only, no code. Sounds, animations and model names: mri-gta-assets (gta-data.mjs).

1. Parser, natives and pitfalls

node scripts/check.mjs <resource folder>        # or a list of .lua files; --no-natives offline

2. Read the flow

Before saying it works, follow the path end to end across every resource involved: the event that triggers it, the callback, what the other side receives, the export it calls.

Lua traps the parser can't see:

3. Reload

4. Logs

Where What it shows
Server: fxserver.log in the txData profile, or the txAdmin live console Started resource, Couldn't start resource, server SCRIPT ERROR
Client: FiveM.app/logs/CitizenFX_log_*.log in the FiveM install client SCRIPT ERROR, No such export, NUI console.log, missing dependency

5. Bug only in game

Don't guess. Add readable logs with a prefix that is easy to filter ([SHOP] [DIAG]) at the moment that matters, printing the state that decides the cause (task status, entity exists, frozen, statebag value). Ask the user to reproduce, read the client log, fix the cause and remove the temporary logs.

6. Web part

Typecheck and build the NUI, and look at it in the browser (see the mri-nui-cef skill).