Introduction
How SixM is built: server, client, resources, launcher and panel, and where each one runs.
SixM is a multiplayer mod for GTA VI on PC, shaped like FiveM: each community hosts its own server, the server sends its resources (recursos) to every player, and the resources make up the game (chat, roleplay, stores, interfaces...).
The pieces
| Piece | Where it runs | What it does |
|---|---|---|
Server (sixm-servidor) | your PC or a VPS, without the game | players, positions, events and the server side of resources |
| Panel | next to the server, port 41761 | like txAdmin: starts, watches over and configures the server (guide) |
| Launcher | the player's PC | server list, settings, loading screen and opening the game |
| Client | inside the player's game | other players' positions and the client side of resources |
| Interface layer | on top of the game | draws the resources' HTML pages inside the game itself |
The server talks to clients over UDP (port 41760 by default) and, over TCP on the same port, serves the loading screen, the information for the launcher and proximity voice.
Resources
A resource is a folder in datos-servidor/recursos/<name>/ with a manifest, server code, client code and, optionally, an HTML interface. They are written in Lua 5.4 or JavaScript (QuickJS) with the same API, and they can be mixed: a JS resource uses the exports of a Lua one and vice versa.
- The server side decides: it stores data, charges money, validates, distributes events.
- The client side is downloaded on join and runs in each player's game: keys, game natives, peds and objects, interface.
- They talk to each other with network events, which the server has to declare one by one.
Resources run in a sealed sandbox: no files, no network, no require or import. What they store goes through the server's KVP storage.
If you come from FiveM
| FiveM | SixM |
|---|---|
fxmanifest.lua | recurso.lua or recurso.json |
server_script, client_script | servidor = {...}, cliente = {...} |
ui_page, files | ui = "ui/index.html", archivos = {...} |
RegisterNetEvent | sixm.red(evento) (on the server) |
AddEventHandler | sixm.on(evento, fn) |
TriggerEvent | sixm.emitir(evento, ...) |
TriggerClientEvent | sixm.al_cliente(id, evento, ...) |
TriggerServerEvent | sixm.al_servidor(evento, ...) |
Citizen.CreateThread, Wait | sixm.hilo(fn), sixm.esperar(ms) |
SetTimeout | sixm.tras(ms, fn) |
exports('x', fn) / exports.r:x() | sixm.exporta("x", fn) / sixm.importa("r").x() |
RegisterCommand | sixm.comando(nombre, fn) |
GetResourceKvpString / SetResourceKvp | sixm.kvp.get / sixm.kvp.set (with tables) |
Natives (GetEntityCoords) | nat.GET_ENTITY_COORDS(...) |
NUI (SendNUIMessage, SetNuiFocus) | sixm.ui.enviar, sixm.ui.foco |
server.cfg with ensure | servidor.cfg with asegura (ensure also works) |
Where to go next
- Your first resource, in Lua and JS.
- Resources and manifest.
- The reference: common API, server and client.
- The roleplay framework, if you are going to make RP resources.