Code and resources
Code, resources and the database
The editor, new resources, packages from the forum and GitHub, Output, Problems and the project database.
Files and the editor
On the left bar, Files: the project tree. A file opens as a tab at the top, in an editor that suggests FiveM natives (name, parameters, client or server side).
Saving a file in resources/ while the server runs restarts the resource it belongs to. A new resource starts by itself. To have it start on the next server start too, add ensure <name> to server.cfg.
The studio builds TypeScript and JavaScript with imports on every restart (esbuild). NUI with Vite or another bundler: a folder with package.json and a build script, and ui_page points at the build output.
A new resource
The + button above the file tree (or “New resource” in the command palette, Ctrl+Shift+P):
- Name: the folder in
resources/[my]/; - Kind: Lua client and server, server only, client only, NUI or TypeScript;
- Libraries in fxmanifest.lua: what the project’s resources offer through their adapters (e.g. the ox_lib library or MySQL from oxmysql). The studio writes their lines into the manifest.
Resources
On the left bar, Resources, with three tabs:
- List: the project’s resources, their live state, start, stop, restart, manifest and removal. Removal needs a stopped server, checks dependencies and moves the folder to the bin. Resources from the framework recipe and from an import are protected.
- Packages and updates:
- From the Cfx.re forum: a search of free releases, the “Only with GitHub” filter, Install straight from the repository named in the thread;
- GitHub repository and From a .zip file… for paid resources (escrow) and packages from elsewhere;
- Check for updates and Update all. The previous version goes to
.studio/backups, and Restore brings it back; - a script that needs a resource the project does not have (
dependencyin its manifest orexports.<resource>calls) gets a warning, and before installing a refusal listing what is missing.
- What the project can do: capabilities and adapters, chapter What the project can do.
Output and Problems
Open the bottom panel from the status bar.
- Output: logs of the studio, the server, the clients and Claude in one place, with filters by source, level and resource and a search box. Under it, Server console: FXServer commands, e.g.
restart nameorensure name. - Problems: script errors with file and line (server and clients), build and manifest errors, scene remarks. Clicking opens the file at that line.
The database
On the left bar, Database. The project database is MariaDB, which starts with the server.
- Tables: browsing by pages, a filter, sorting by column, editing a cell (JSON in the editor), adding and deleting a row, Structure with columns, keys and indexes, a New table.
- Snapshots: a copy of the whole database in one click and going back to it. The studio takes them by itself before a migration, test data, a scenario, a package update and a restore.
- Load a database dump…: a
.sqlor.sql.gzfile from another server (mysqldump, HeidiSQL, phpMyAdmin). The studio takes a snapshot first, and the report gives the number of tables before and after. - Migrations and test data: files in
db/migrationsrun once, in order. Apply pending runs the new ones. A deploy runs the same migrations on production.