Getting started¶
What you need¶
- Node.js 24 (or 22.18+): gamemodes are TypeScript files Node runs directly (type stripping), or plain JavaScript.
- The SAGL server package,
@sagl/server, innode/of this repository (npm run buildthere builds the native addon and the TypeScript). - Players need GTA San Andreas (v1.0 US) with the SAGL client installed;
scripts/package-client.shbuilds the client package.
Running the example¶
The repository has an example gamemode, examples/freeroam:
It listens on UDP port 7777. Players connect by putting the server in their
sagl/sagl.ini:
The standalone server¶
build/server/server/sagl-server is a server with no gamemode: players can
join and drive about. Useful for testing the client.
sagl-server [--port N] [--name NAME] [--max-players N] [--time HH:MM]
[--freeze-time | --run-time] [--money N] [--weather N]
[--proxy IP]... [--client-files DIR]
Next: write your first gamemode.