Skip to content

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, in node/ of this repository (npm run build there builds the native addon and the TypeScript).
  • Players need GTA San Andreas (v1.0 US) with the SAGL client installed; scripts/package-client.sh builds the client package.

Running the example

The repository has an example gamemode, examples/freeroam:

cd node && npm install && npm run build
cd ../examples/freeroam && npm install && npm start

It listens on UDP port 7777. Players connect by putting the server in their sagl/sagl.ini:

[client]
host = 127.0.0.1
port = 7777
name = YourName

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.