Grand opening25% off everything with FAM-261023-261025-UL4B9this weekendAdded for you at checkout Halloween Edition36 maps, limited runlimited runShop the drop
Chapter 06 of 17The Server Handbook for FiveM

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.

A resources folder that stays readable at 200 resources
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, minimap
fxmanifest.lua — a typical script resource
fx_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' }
CommandWhat it does
ensure nameStarts the resource, or restarts it if it is running
start name / stop nameStart or stop; also works on categories such as start [cars]
restart nameRestarts a running resource
refreshRescans the resources folder so new resources can be started
exec file.cfgRuns 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, then ensure 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.

The Server Handbook for FiveM

This chapter is one of 17. The handbook also carries the console command and convar cheat sheets, a glossary and the official references every chapter is checked against.

Open the handbook