- How to Make a FiveM Server (2026 Step-by-Step)
From an empty VPS to a public GTA V roleplay server: artifacts, licence key, server.cfg, framework, database, OneSync and the launch checklist. /guides/how-to-make-a-fivem-server
- ESX vs QBCore vs Qbox: Best FiveM Framework 2026
Data models, inventories, script ecosystems, performance and hiring cost — the real differences between the three FiveM frameworks. /guides/esx-vs-qbcore-qbox
- FiveM Server Optimization: Fix Lag & Server MS
Read resmon properly, kill per-frame loops, tune OneSync and entity limits, and find the database query that is freezing your server. /guides/fivem-server-optimization
- FiveM NUI Development: In-Game UIs with React
CEF quirks, the Lua↔JS contract, React/Next.js builds, NUI focus, and the CSS that silently fails inside the game. /guides/fivem-nui-development
- FiveM Server Security: Stop Exploits & Backdoors
Event validation, trust boundaries, backdoored resources, txAdmin hardening and what anti-cheat can and cannot do. /guides/fivem-server-security
- How Much Does a FiveM Server Cost in 2026?
Hosting, scripts, MLOs, developer rates and branding — what a 32, 64 and 128-slot roleplay server actually costs per month. /guides/fivem-server-cost
- How to Hire a FiveM Developer in 2026
Writing a brief, screening questions that actually work, rates, IP and escrow, milestones, and the red flags to walk away from. /guides/hire-a-fivem-developer
- FiveM Asset Streaming: MLOs, Cars & Crashes
Stream folders, add-on vehicles, MLOs, texture budgets and pool sizes — and how to find the asset that is crashing your players. /guides/fivem-custom-assets-streaming
- FiveM Loading Screen: Build, Host & Install
How loadscreen resources work, adding music and video, live player counts, and installing one without breaking your spawn. /guides/fivem-loading-screen
- Custom FiveM Minimap: Install & Postal Codes
How minimap tiles and the LOD map work, installing a custom map, postal codes, and fixing blurry or missing tiles. /guides/fivem-minimap-guide
- FiveM Weapon Skins: Textures & ox_inventory
Weapon models, texture dictionaries and tints — how skins are made, streamed and wired into ox_inventory as real items. /guides/fivem-weapon-skins-guide
- GTA 6 Roleplay: What FiveM Owners Should Do Now
What carries over from FiveM, what certainly does not, and the work that pays off today whether GTA 6 RP arrives in one year or four. /guides/gta-6-roleplay-servers
- FiveM Scripting Language: Lua vs C# vs JavaScript (2026)
Learn Lua first. It is what almost every public FiveM resource and every major framework (ESX, QBCore, Qbox, ox) is written in, so it is the language you will read, copy and debug most. Add JavaScript or TypeScript when you build NUI interfaces or want the npm ecosystem on the server, and consider C# if you already know .NET and want strong typing. /guides/fivem-scripting-language-lua-csharp-javascript
- What Is a FiveM Resource? fxmanifest.lua, Folders and ensure
A resource is a folder inside resources/ containing an fxmanifest.lua. The manifest declares the format (fx_version 'cerulean', game 'gta5'), which scripts run on the client, the server or both, which extra files clients download, and what the resource depends on. The server starts it when server.cfg says ensure foldername. /guides/what-is-a-fivem-resource
- FiveM Client vs Server Scripts: What Runs Where and Why
Client scripts run on each player’s PC and handle what that player sees and does: drawing, input, markers, animations and local effects. Server scripts run once, on your server, and own everything that has value or must be trusted: money, items, jobs, the database and permissions. The client asks; the server decides. Never trust data sent by a client without checking it. /guides/fivem-client-vs-server-scripts
- FiveM State Bags: GlobalState, Player and Entity State
A state bag is a set of key–value pairs attached to something: GlobalState (the whole server), Player(source).state (a player) or Entity(entity).state (an entity; also LocalPlayer.state on the client). Set a value on the server and it replicates to clients that can see it; clients react with AddStateBagChangeHandler. Clients can only write their own values when the server allows it, and those writes must never be trusted. /guides/fivem-state-bags
- FiveM Commands and Key Mapping: RegisterKeyMapping Guide
Register a command with RegisterCommand(name, handler, restricted). Setting restricted to true on the server requires the ACE command.name. Bind a client command to a rebindable key with RegisterKeyMapping(command, description, 'keyboard', 'F5'), which adds it to the game’s Key Bindings settings. Use +name/-name commands for keys that act while held. /guides/fivem-commands-key-mapping
- Your First FiveM Script: A Step-by-Step Lua Tutorial
Create a folder resources/my_first, add an fxmanifest.lua with fx_version 'cerulean', game 'gta5', a client_script and a server_script, then write a client command that loads a model with RequestModel, waits for HasModelLoaded, spawns it with CreateVehicle and seats the player with SetPedIntoVehicle. Add ensure my_first to server.cfg, restart, and type /car adder in game. /guides/your-first-fivem-script
- Lua Basics for FiveM: Variables, Functions and Loops
Always declare variables with local. Lua has nil, booleans, numbers, strings, tables and functions; only nil and false are falsy (0 and empty strings are true). Use if/elseif/else, numeric for i = 1, 10, for k, v in pairs(t) and while. Concatenate strings with .. and format with string.format. CfxLua adds vector3, backtick hashes, CreateThread and Wait. /guides/lua-basics-for-fivem
- Lua Tables in FiveM: Arrays, Dictionaries, Configs and JSON
A table can be an array ({ 'a', 'b' }, indexed from 1) or a dictionary ({ price = 5 }), or both. Loop arrays with ipairs and dictionaries with pairs. #t counts only the array part up to the first gap. Tables are passed by reference, so copying requires a copy function. json.encode and json.decode convert tables for NUI, HTTP and databases. /guides/lua-tables-for-fivem
- FiveM Events Explained: TriggerServerEvent and Net Events
Handle events with AddEventHandler(name, fn); add RegisterNetEvent(name) (or use RegisterNetEvent(name, fn)) to allow the event to arrive over the network. TriggerEvent fires locally on the same side, TriggerServerEvent sends from a client to the server, and TriggerClientEvent(name, target, ...) sends from the server to one player (target = player ID) or everyone (-1). On the server, source is the sending player. /guides/fivem-events-explained
- FiveM Natives Explained: How to Use the Native Reference
Natives are the game’s built-in functions. The Cfx native reference lists them by namespace (PLAYER, ENTITY, VEHICLE…) with parameters and notes. In Lua and JS you call them in PascalCase — GET_ENTITY_COORDS becomes GetEntityCoords. Some are client-only, some server-only (the CFX namespace), and out-parameters come back as extra return values. /guides/fivem-natives-explained
- FiveM Threads and Wait(0): CreateThread and Performance
CreateThread(fn) starts a coroutine that runs alongside the game; Wait(ms) pauses it and lets everything else run. Wait(0) resumes on the next frame, so the loop runs every frame (60+ times a second). Use it only while you must draw or read input every frame; otherwise sleep for hundreds of milliseconds, and make loops adaptive — fast when the player is near something, slow when they are not. /guides/fivem-threads-and-wait
- FiveM Exports Explained: exports() Across Resources
Define an export with exports('name', function(...) end) in Lua (or list the function under export/server_export in the manifest), then call it from another resource with exports.resource:name(...) or exports['resource-name']:name(...). Exports work on the same side only — client exports from client scripts, server exports from server scripts — and return values directly, unlike events. /guides/fivem-exports-explained
- oxmysql Guide: FiveM Database Queries, Setup and Async
Point oxmysql at your database with set mysql_connection_string "mysql://user:password@localhost:3306/database" in server.cfg, add server_script '@oxmysql/lib/MySQL.lua' to your resource, and call MySQL.query.await, MySQL.single.await, MySQL.scalar.await, MySQL.insert.await, MySQL.update.await or MySQL.prepare.await with ? placeholders. Enable mysql_slow_query_warning to catch slow queries. /guides/fivem-oxmysql-guide
- FiveM resmon Explained: Resource Time (ms) and Fixing Lag
Press F8 and type resmon 1 (or resmon true) to open the client resource monitor. The CPU msec column is how many milliseconds per frame each resource uses; idle resources should sit near 0.00–0.02 ms, and anything consistently above about 0.5 ms deserves a look. Sort by CPU, reproduce the situation where it lags, and inspect the worst resource’s loops. /guides/fivem-resmon-resource-time
- FiveM Errors: F8 Console, Server Console and SCRIPT ERROR
Client script errors appear in the F8 console in game; server script errors appear in the server console (or txAdmin’s Live Console). A SCRIPT ERROR: @resource/client.lua:23: attempt to index a nil value (local 'data') line tells you the resource, the file, the line number and what went wrong. Read the first error, not the last — later errors are often consequences of the first. /guides/fivem-f8-console-and-server-errors
- FiveM Database Design: Tables, Keys and Indexes
Give every table a primary key, reference characters by one stable identifier (citizenid on QBCore, identifier on ESX), index every column you search or join on, use utf8mb4 so names with emoji work, store small flexible data as JSON but put anything you search or count in real columns, and add created_at/updated_at timestamps. /guides/fivem-database-design
- FiveM Profiler Guide: profiler record, view and saveJSON
Run profiler record 500 in the server console (or F8 on the client) to record about 500 frames, check progress with profiler status, then run profiler view to open the result in Chrome, or profiler saveJSON name.json to save it. In Chrome DevTools’ Performance tab, look for tall frames and hover the coloured blocks to see the resource, file and line. /guides/fivem-profiler-guide
- Common FiveM Lua Errors and How to Fix Them
“Attempt to index a nil value” means you used . or [] on something that is nil — the object you expected was never set. “Attempt to call a nil value” means the function does not exist. Arithmetic, concatenate and compare errors mean a value you used is nil. Syntax errors (“'end' expected”, “unexpected symbol”) point at a missing keyword or character near the named line. /guides/fivem-common-lua-errors
- FiveM Convars Explained: set, sets, setr and GetConvar
set name value creates a server-only convar. sets name value also publishes it to the server list (for tags, locale, banners). setr name value replicates it to clients so client scripts can read it. Read convars with GetConvar(name, default) (strings) or GetConvarInt(name, default) (integers). Never use setr or sets for secrets. /guides/fivem-convars-guide
- FiveM KVP Storage: SetResourceKvp for Client Settings
SetResourceKvp(key, value) stores a string (or SetResourceKvpInt/Float for numbers) scoped to the resource; read it back with GetResourceKvpString, GetResourceKvpInt or GetResourceKvpFloat, and remove it with DeleteResourceKvp. On the client it is stored on the player’s PC for your server; on the server it is stored with the server. Use it for small, simple values, not for shared or valuable data. /guides/fivem-kvp-storage
- FiveM Entity Ownership and Network IDs Explained (OneSync)
Entity handles are local to each client and to the server; never send them over events. Convert to a network ID with NetworkGetNetworkIdFromEntity, send the ID, and convert back with NetworkGetEntityFromNetworkId (or NetToVeh/NetToPed/NetToObj on the client). Each networked entity has an owner that simulates it; other clients must request control before changing it, and ownership migrates when the owner leaves. /guides/fivem-entity-ownership-network-ids
- Spawning Vehicles, Peds and Objects Server-Side in FiveM
On the server, create vehicles with CreateVehicleServerSetter(model, type, x, y, z, heading) — it is more reliable than the RPC-based CreateVehicle. Wait for DoesEntityExist, set plate and state, put the player in with SetPedIntoVehicle, and send the network ID to the client if it needs to do more. Delete with DeleteEntity. Once all scripts spawn server-side, enable sv_entityLockdown. /guides/fivem-server-side-entities
- Secure FiveM Server Events: Validation That Stops Exploits
Any client can call any event you registered with RegisterNetEvent, with any arguments. In each handler: copy source into a local, check argument types and ranges, re-derive everything from server state (prices, amounts, rewards), verify the player can do this now (distance, job, item, cooldown), and log refusals. Events only other server scripts should use are registered with AddEventHandler alone, so clients cannot trigger them. /guides/fivem-secure-server-events
- FiveM Anticheat Basics: A Layered Defence for Server Owners
Build in layers: make the server the authority for money, items and entities; validate every net event; enable sv_entityLockdown once scripts spawn server-side; filter dangerous game events (explosionEvent, weaponDamageEvent, clearPedTasksEvent) on the server; ban on several identifiers plus GetPlayerToken tokens; add honeypot events; and log everything. A commercial anticheat adds client-side detection on top — it does not replace the rest. /guides/fivem-anticheat-basics
- ox_lib Guide: Callbacks, Notify, Menus, Zones and Commands
Start ox_lib before your resource, add shared_script '@ox_lib/init.lua' and lua54 'yes' to your fxmanifest, and the global lib becomes available. Use cache.ped/cache.vehicle instead of calling natives in loops, lib.callback for client↔server requests, lib.notify, lib.progressBar, lib.registerContext/lib.showContext, lib.inputDialog, lib.points and lib.zones for interaction, and lib.addCommand for commands with ACE restrictions. /guides/ox-lib-guide
- FiveM Callbacks Explained: ox_lib, ESX and QBCore
A callback registers a named handler on one side and lets the other side call it and receive its return value. With ox_lib use lib.callback.register on the server and lib.callback.await on the client (it also works server → client). ESX uses ESX.RegisterServerCallback / ESX.TriggerServerCallback, QBCore QBCore.Functions.CreateCallback / QBCore.Functions.TriggerCallback. Validate inside callbacks exactly like events. /guides/fivem-callbacks-explained
- FiveM Zones: ox_lib Zones vs PolyZone (Box, Sphere, Poly)
With ox_lib, create zones with lib.zones.box, lib.zones.sphere or lib.zones.poly and handle onEnter, onExit and inside. Use the restricted /zone poly|box|sphere command to draw zones in game; ox_lib saves them to created_zones.lua. PolyZone is the older library many QBCore resources still use. Zones run on the client — confirm anything important on the server. /guides/fivem-zones-polyzone-ox-lib
- ox_target Guide: Models, Entities, Zones and Options
Call ox_target exports from your client script: addModel for every prop of a model, addGlobalVehicle/addGlobalPed/addGlobalPlayer for all of a type, addLocalEntity/addEntity for specific entities, and addBoxZone/addSphereZone for places. Each option has a name, label, icon, optional distance (default 7), groups, items and canInteract, and runs onSelect, an event, a serverEvent or a command. /guides/ox-target-guide
- ESX Legacy Script Tutorial: xPlayer, Money, Items and Jobs
Import ESX with shared_script '@es_extended/imports.lua' (or exports.es_extended:getSharedObject()). On the server, ESX.GetPlayerFromId(source) returns xPlayer, which handles money (addMoney, addAccountMoney('bank', …)), items (addInventoryItem, getInventoryItem), and the job (xPlayer.job.name, .grade). Register usable items with ESX.RegisterUsableItem and commands with ESX.RegisterCommand. On the client use ESX.PlayerData and the esx:playerLoaded and esx:setJob events. /guides/esx-legacy-script-tutorial
- QBCore Script Tutorial: Player, Money, Items and Jobs
Get the core with local QBCore = exports['qb-core']:GetCoreObject(). On the server, QBCore.Functions.GetPlayer(source) returns the Player: read Player.PlayerData (citizenid, job, money) and change state with Player.Functions.AddMoney('cash', n), AddItem, RemoveItem, SetJob. Register usable items with QBCore.Functions.CreateUseableItem, commands with QBCore.Commands.Add. On the client use QBCore.Functions.GetPlayerData() and the QBCore:Client:OnPlayerLoaded / OnJobUpdate events. /guides/qbcore-script-tutorial
- Qbox Script Tutorial: qbx_core Exports, Groups and Money
On the server call qbx_core exports: exports.qbx_core:GetPlayer(source), AddMoney(source, 'cash', amount, reason), SetJob(source, job, grade), HasGroup(source, filter) and Notify(source, text, type). On the client, add '@qbx_core/modules/playerdata.lua' to get QBX.PlayerData, kept in sync automatically. Items and inventories go through ox_inventory; UI through ox_lib. A bridge keeps most QBCore scripts working. /guides/qbox-script-tutorial
- ox_core Overview: The Overextended Framework for Developers
ox_core manages users, characters, groups, bank accounts and persistent vehicles. In Lua, load it with local Ox = require '@ox_core.lib.init' and use Ox.GetPlayer(source) (an OxPlayer with charId, getGroup…), Ox.GetCharacterAccount(charId) for bank accounts (addBalance, removeBalance, transferBalance), and Ox.CreateVehicle for owned vehicles. JavaScript/TypeScript resources use the @overextended/ox_core npm package. Money in hand and items are ox_inventory items. /guides/ox-core-overview
- Framework Bridges: One FiveM Script for ESX, QBCore and Qbox
Detect the running framework with GetResourceState('qbx_core'), ('qb-core') and ('es_extended'), load a matching bridge file, and have every bridge expose the same functions — get player identifier, job, money add/remove, notify, item add/remove. Keep framework calls out of your main logic, allow a config override, and test on each framework you claim to support. /guides/fivem-standalone-scripts-bridges
- Git for FiveM Servers: Setup, .gitignore and Deploys
Initialise a repository in your server-data folder (or per script), commit resources and configs, and ignore caches, logs, txData and anything secret. Move the licence key, database password and tokens into a separate secrets.cfg that is exec’d but never committed. Use Git LFS or keep huge streamed assets out of the repo, work on branches, push to a private remote, and deploy with git pull on the server. /guides/fivem-git-version-control
- FiveM Local Development Server: Test Scripts on Your Own PC
Run FXServer on your PC (txAdmin or vanilla), point it at a copy of your server-data and a separate development database, and connect from FiveM with connect localhost:30120. sv_lan true makes the server LAN-only and skips the licence key check. Use ensure <resource> after edits and refresh for new resources, keep game build and OneSync settings identical to production, and test multiplayer logic with a second account or machine. /guides/fivem-local-development-server
- VS Code Setup for FiveM Development: Lua, Natives and Types
Install the Lua extension (Lua Language Server by sumneko/LuaLS). Clone Overextended’s fivem-lls-addon — the replacement for the discontinued CfxLua IntelliSense extension — into a folder for Lua addons, point workspace.userThirdParty at that folder in a .luarc.json, and add ox_lib to workspace.library. For JavaScript/TypeScript, install @citizenfx/client and @citizenfx/server typings. /guides/vscode-setup-for-fivem
- Lua Annotations for FiveM: @param, @class and Typed Configs
Annotate functions with ---@param name type and ---@return type, describe table shapes with ---@class and ---@field, restrict strings with ---@alias, and mark variables with ---@type. The language server then checks calls and completes fields. Annotations are comments, so they cost nothing at runtime. Start with configs and shared data shapes — they catch the most bugs. /guides/fivem-lua-language-server-annotations
- FiveM Scripts in TypeScript: Setup, Build and Typings
Install @citizenfx/client, @citizenfx/server, TypeScript and esbuild. Write src/client and src/server, bundle each into a single file (dist/client.js, dist/server.js), and list those in the fxmanifest. Client JS has the ES2017 standard library but no browser or Node APIs; server JS runs on Node.js 16 by default, or Node 22 with node_version '22' in the manifest. Type other resources’ exports by extending CitizenExports. /guides/fivem-typescript-scripts
- FiveM Scripts in C#: CitizenFX, BaseScript and Events
Install the templates with dotnet new -i CitizenFX.Templates, create a resource with dotnet new cfx-resource, and build with the included build.cmd to get client and server DLLs in dist. Each script class inherits BaseScript, registers events through EventHandlers[...], and calls natives via using static CitizenFX.Core.Native.API. Link dist into your resources folder and ensure it. /guides/fivem-csharp-scripts
- FiveM Asset Escrow Explained: How Protected Scripts Work
Asset escrow encrypts Lua, YFT, YDD and YDR files uploaded to the Cfx.re Portal and delivers them through Tebex. An escrowed resource only starts on servers whose owner holds the entitlement; otherwise the console shows “You lack the required entitlement”. Sellers leave config files editable with escrow_ignore. NUI files are not encrypted. Re-uploading replaces the version on the seller’s account, and subscription assets stop working when the subscription ends. /guides/fivem-asset-escrow-explained
- Selling FiveM Scripts on Tebex: Setup, Escrow and Launch
Create a Tebex account, complete identity verification, make a project and link your Cfx.re account. Upload your zipped resource to the Cfx.re Portal to escrow it, then create a Tebex package that delivers that “FiveM Asset”. Buyers get it in their Portal account and it runs on servers they own. Escrowed assets can only be distributed through Tebex. Add a clear description, a video preview, documentation and a support channel before launch. /guides/selling-fivem-scripts-tebex
- How to Price FiveM Scripts: A Framework for Developers
Start from the alternatives buyers see (similar scripts, free options), adjust for what makes yours better (performance, frameworks supported, UI quality, docs), and make sure the price covers the support each sale brings. Offer a cheaper escrowed tier and a pricier open-source tier, use bundles for related scripts, run launch discounts with an end date, and revisit prices after real sales data. /guides/fivem-script-pricing
- Building a FiveM Developer Portfolio That Gets You Hired
Show five or six of your best finished pieces with short in-game videos, link clean open-source samples on GitHub, and write brief case studies (problem, solution, result, resmon numbers). State your stack (Lua, ox_lib, frameworks, NUI), services and availability clearly, add testimonials from real clients, and keep contact one click away. /guides/fivem-developer-portfolio
- FiveM Freelance: Scope, Deposits, Ownership and Contracts
Before starting, agree in writing on the scope (features, frameworks, what is not included), price and milestones, a deposit, delivery format (open source or escrowed), who owns the code afterwards, how many revisions are included, the support period and confidentiality. Work on a test server, not the client’s live one, and deliver in milestones. This is practical guidance, not legal advice. /guides/fivem-freelance-contracts
- Documenting FiveM Scripts: README, Config and Support Docs
Structure docs as: what it does, requirements (dependencies with versions), installation (exact steps, SQL, ensure order), configuration (every option with default and example), usage (commands, keybinds, items), developer API (exports and events with parameters), troubleshooting (common errors and fixes), FAQ and a changelog. Keep it in the resource as a README and publish a searchable docs site for bigger products. /guides/fivem-script-documentation
- config.lua Best Practices for FiveM Scripts
Put values owners change (locations, prices, jobs, feature toggles) in config.lua, keep logic out of it, and split server-only values (webhooks, tokens, reward amounts) into a server-side config that is never sent to clients. Group settings, name them clearly, ship working defaults, validate the config at startup with readable errors, and leave config files editable under escrow with escrow_ignore. /guides/fivem-config-lua-best-practices
- Localizing FiveM Scripts: ox_lib, ESX and QBCore Locales
With ox_lib, add ox_lib 'locale' to the fxmanifest, put strings in locales/en.json (and other languages), call locale('key', ...) in code, and server owners choose the language with setr ox:locale de. ESX Legacy uses Translate/TranslateCap with Lua locale tables; QBCore uses Locale:new and Lang:t('key'). Use placeholders instead of string concatenation, fall back to English, and send UI strings to NUI in one message. /guides/fivem-localization-locales
- SQL Injection in FiveM: Prepared Statements with oxmysql
Never concatenate or format player-controlled values into SQL. Use oxmysql placeholders — ? or named @name parameters — and pass values separately, so they are always treated as data. Table and column names cannot be parameters: pick them from a fixed whitelist. Validate types (numbers are numbers), escape % and _ in LIKE searches, and give the server’s database user only the rights it needs. /guides/fivem-sql-injection-prevention
- Rate Limiting FiveM Events and Callbacks to Stop Exploits
Give every expensive or rewarding server event a per-player limit. A simple cooldown (one call per N seconds) covers most actions; a token bucket allows short bursts with a sustained rate. Key limits by player and event, clear them on playerDropped, log players who hit limits repeatedly, and never rely on client-side delays. FiveM for GTAV Enhanced adds rateLimiter_* convars for built-in network limits. /guides/fivem-event-rate-limiting
- Lua Performance in FiveM: Getting Scripts to 0.00 ms
Sleep loops dynamically (long Wait when nothing is nearby, Wait(0) only when you must draw or read input), replace polling with events and state bags, measure distance with #(a - b) on vectors, read values like the player ped once per tick (or from ox_lib’s cache), use backtick hashes, avoid creating tables and strings in hot loops, and batch database writes. Measure before and after with resmon and the profiler. /guides/fivem-lua-performance-optimization
- Memory Leaks in FiveM Lua Scripts: Finding and Fixing Them
Measure first: watch the resource’s memory in resmon or print collectgarbage('count') (kilobytes) over time. The usual culprits are per-player tables not cleared on playerDropped, handlers or threads created inside other handlers, caches without size limits, and entities or blips created and never deleted. Clean up on playerDropped and onResourceStop, bound every cache, and register handlers once at file level. /guides/fivem-memory-leaks
- FiveM HTTP Requests: PerformHttpRequest, JSON and Headers
PerformHttpRequest(url, function(statusCode, body, headers, errorData) ... end, method, data, headers) sends a request and calls back with the result. Encode JSON bodies with json.encode, set Content-Type and auth headers, and decode responses with json.decode. Wrap it in a promise and Citizen.Await to get a synchronous style. Keep API keys in server-only convars and make requests from the server. /guides/fivem-http-requests-performhttprequest
- FiveM Discord Webhook Logging: Embeds, Limits and Privacy
From the server, POST a JSON body with an embeds array (title, description, integer color, fields, ISO timestamp) to the webhook URL using PerformHttpRequest. Keep the URL in a server-only convar (set), respect Discord’s limits (for example 256 characters for titles, 4096 for descriptions, 1024 per field value, up to 10 embeds per message) and back off on HTTP 429, batch noisy events, and log identifiers only where staff need them. /guides/fivem-discord-webhook-logging
- Scheduled Tasks in FiveM: Intervals, Clock Times and cron
For “every N minutes”, run a loop with Wait(ms) in a thread. For a one-off delay, use SetTimeout(ms, fn). For clock times (“every day at 06:00”), use lib.cron.new('0 6 * * *', fn) from ox_lib on the server, which parses standard cron expressions (minute, hour, day, month, weekday). Keep jobs short, persist state in the database so restarts do not skip or repeat them, and use txAdmin’s restart events for pre-restart work. /guides/fivem-scheduled-tasks-cron
- FiveM Code Review Checklist: Security and Performance
Check security (every net event and callback validates input and permissions, SQL uses placeholders, no secrets in client files), performance (idle loops sleep, no per-frame natives when not needed, resmon near 0.00 ms idle), correctness (cleanup on playerDropped and onResourceStop, no handlers registered repeatedly), compatibility (framework/inventory bridges, dependencies declared), and usability (config, locales, docs, clear errors). /guides/fivem-code-review-checklist
- Best Resources to Learn FiveM Development: Docs and Forums
Start with the official documentation at docs.fivem.net (scripting manual, server manual) and the natives reference at docs.fivem.net/natives. Learn Lua itself from the Lua 5.4 manual and Programming in Lua. Use your framework’s own docs — docs.esx-framework.org, docs.qbcore.org, docs.qbox.re, overextended.dev for ox_lib/ox_inventory/oxmysql — and ask on forum.cfx.re. Read well-maintained open-source resources to see real patterns. /guides/fivem-learning-resources
- Migrating from ESX to QBCore or Qbox: Scripts and Data
Map the ESX API to QBCore/Qbox (xPlayer.addMoney → Player.Functions.AddMoney('cash', …) or exports.qbx_core:AddMoney, xPlayer.job.grade → PlayerData.job.grade.level, inventory calls to your inventory’s exports), convert data from users (keyed by identifier) to players (keyed by citizenid), and decide per script whether to rewrite, bridge or replace. Migrate on a copy of the database, test every job and shop, and move players in one planned maintenance window. /guides/fivem-framework-migration-esx-to-qbcore
- FiveM Inventory Integration: ox_inventory and qb-inventory
ox_inventory: exports.ox_inventory:AddItem(src, item, count, metadata), RemoveItem, GetItemCount, CanCarryItem. qb-inventory: exports['qb-inventory']:AddItem(src, item, amount, slot, info, reason), RemoveItem, GetItemCount, HasItem. ESX default: xPlayer.addInventoryItem, removeInventoryItem, getInventoryItem(name).count, canCarryItem. Detect the inventory with GetResourceState, wrap the calls in one module, and keep item names configurable. /guides/fivem-inventory-integration-for-developers
- NUI ↔ Lua Communication Patterns for FiveM
Send { action, data } messages with SendNUIMessage and route them by action in the page. The page calls Lua with fetch('https://<resource>/<callback>'), handled by RegisterNuiCallback, which always calls cb. For server data, the NUI callback triggers a server callback (for example lib.callback.await) and returns the result to the page. Push state on change instead of polling, throttle fast values, manage focus explicitly, and validate everything on the server. /guides/fivem-nui-to-lua-communication-patterns
- FiveM Developer Roadmap: From Zero to Professional Scripter
Stage 1: Lua basics and your first resource. Stage 2: client vs server, events, natives and threads. Stage 3: a framework (ESX, QBCore or Qbox), ox_lib and the database with oxmysql. Stage 4: NUI interfaces. Stage 5: performance (resmon, profiler) and security (validated events, SQL placeholders). Stage 6: tooling (VS Code, Git, local server). Stage 7: documentation, selling on Tebex, freelancing and a portfolio. /guides/fivem-developer-roadmap