Skip to main content

Custom loading screen

Your loading screen is the loadingscreen/ folder next to client_packages/. Edit its index.html, and put any CSS, JS, images, fonts or music it needs in the same folder, linked with relative paths (style.css, img/bg.jpg).

The page is shown:

  • from the moment GTA starts until the player is in the world and the gamemode has started;
  • again as soon as the connection drops ("Connection lost, reconnecting").

The launcher downloads it together with the other server files (encrypted, like client_packages), so players see it from the first frame. Without a loadingscreen/ folder the client shows its built-in page.

Keep it light: every player downloads it before anything else, and the server warns above 50 MB. After you change it, connected players get the new version on their next reconnect; everyone else gets it from the launcher on their next start.

API​

The client pushes its state into the page, and the page only draws it:

window.addEventListener('syncmp:state', function (e) { render(e.detail); });
if (window.__syncmp) render(window.__syncmp); // state that arrived before your listener

e.detail​

FieldMeaning
stage"game" GTA itself is loading · "connecting" · "checking" comparing files with the server · "downloading" (see progress, files, bytes) · "loading" loading the world / starting the gamemode · "ready" in the world: fade out, the page stops being drawn ~1 s later · "reconnecting" the connection was lost and the client is reconnecting · "disconnected" the server sent the player away (kick/ban), see reason
textDefault English text for the stage (use it, or localise by stage)
progress0..1 while downloading, -1 otherwise
files{ done, total }
bytes{ done, total }
server"host:port"
reasonWhy the connection ended ("server restarting", "connection lost", kick reason)
attemptReconnect attempt number
retryInSeconds until the next reconnect attempt
noticeAn important one-line message (for example "restart the game to load new DLC packs")
tip

After "ready" the page can be shown again ("reconnecting"), so undo your fade-out whenever the stage is anything other than "ready".

The page has no window.mp: it cannot talk to the gamemode, and the gamemode cannot see it. It may load web content (fonts, CDN video), but files in the folder load fastest and work offline.