SAGL¶
SAGL is a multiplayer mod for GTA San Andreas. The server is in charge: it decides what players have, sees every shot and hit and can veto damage, and it runs gamemodes written in TypeScript/JavaScript on Node.js. Gamemodes can also send client scripts, sandboxed JavaScript that runs in each player's game, with UI documents of their own in the game's look.
- Getting started: run a server and write your first gamemode.
- Gamemodes: guides to players, vehicles, peds, worlds, zones, client files and branding.
- Server API: every class, option and event of
@sagl/server. - Client scripting: the
saglAPI in players' games: channels, UI, the map, files. - Styling and layouts: the GTA SA theme, the game's fonts, and laying out your own documents.
How it fits together¶
flowchart LR
GM[Your gamemode<br/>Node.js] --> S[@sagl/server<br/>native addon]
S <-->|ENet / UDP| C1[Player's game<br/>sagl client]
S <-->|ENet / UDP| C2[Player's game]
C1 --- CS[Client scripts<br/>QuickJS sandbox]
CS --- UI[RmlUi documents]
- Server:
@sagl/server(a Node.js package with a native addon) holds the authoritative state: players, vehicles, peds, weapons, money, worlds. There's also a standalonesagl-serverbinary with no gamemode, for tests. - Client: an ASI plugin in the player's GTA San Andreas. It syncs the player, draws everyone else, and runs the server's client scripts.
- Client files: a directory on the server that players download when they join and cache. Scripts, UI documents, images and the server's branding live there.
Work in progress
The APIs here are current as of this version and will grow. See the roadmap for what's planned.