Resources, fxmanifest.lua and start order
In short
Every feature on a FiveM server is a resource: a folder with an fxmanifest.lua. Organised folders and a clear start order prevent most “it worked yesterday” problems.
resources/
[base]/ mapmanager, chat, spawnmanager, sessionmanager, hardcap
[libs]/ oxmysql, ox_lib, ox_target
[framework]/ qbx_core or es_extended and its core resources
[jobs]/ police, ambulance, mechanic
[maps]/ MLOs and ymaps
[vehicles]/ add-on cars
[ui]/ hud, loading screen, minimapfx_version 'cerulean'
game 'gta5'
lua54 'yes'
name 'nc_garage'
version '1.2.0'
shared_scripts { '@ox_lib/init.lua', 'config.lua' }
client_scripts { 'client/*.lua' }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
ui_page 'web/dist/index.html'
files { 'web/dist/**' }
dependencies { 'oxmysql', 'ox_lib' }| Command | What it does |
|---|---|
ensure name | Starts the resource, or restarts it if it is running |
start name / stop name | Start or stop; also works on categories such as start [cars] |
restart name | Restarts a running resource |
refresh | Rescans the resources folder so new resources can be started |
exec file.cfg | Runs commands from another file, including @resource/file.cfg |
- Bracket folders such as
[jobs]are categories:ensure [jobs]starts everything inside. - Start libraries before anything that uses them: oxmysql and ox_lib, then the framework, then jobs and UI.
- After copying in a new folder on a running server:
refresh, thenensure name. - Leave the default cfx-server-data resources unedited unless you must — updates become painful.
- Delete what you do not use. Every client script costs frame time on every player’s PC.