SixM
Single player ↗

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

PieceWhere it runsWhat it does
Server (sixm-servidor)your PC or a VPS, without the gameplayers, positions, events and the server side of resources
Panelnext to the server, port 41761like txAdmin: starts, watches over and configures the server (guide)
Launcherthe player's PCserver list, settings, loading screen and opening the game
Clientinside the player's gameother players' positions and the client side of resources
Interface layeron top of the gamedraws 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

FiveMSixM
fxmanifest.luarecurso.lua or recurso.json
server_script, client_scriptservidor = {...}, cliente = {...}
ui_page, filesui = "ui/index.html", archivos = {...}
RegisterNetEventsixm.red(evento) (on the server)
AddEventHandlersixm.on(evento, fn)
TriggerEventsixm.emitir(evento, ...)
TriggerClientEventsixm.al_cliente(id, evento, ...)
TriggerServerEventsixm.al_servidor(evento, ...)
Citizen.CreateThread, Waitsixm.hilo(fn), sixm.esperar(ms)
SetTimeoutsixm.tras(ms, fn)
exports('x', fn) / exports.r:x()sixm.exporta("x", fn) / sixm.importa("r").x()
RegisterCommandsixm.comando(nombre, fn)
GetResourceKvpString / SetResourceKvpsixm.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 ensureservidor.cfg with asegura (ensure also works)

Where to go next

  1. Your first resource, in Lua and JS.
  2. Resources and manifest.
  3. The reference: common API, server and client.
  4. The roleplay framework, if you are going to make RP resources.