Skip to content

screenshot-basic compatibility

screenshot-basic is the standard FiveM capture resource, and it’s the SDK’s only hard dependency: every capture (takeImage, takeServerImage) goes through it. If your server already runs it for other scripts, nothing about their setup changes.

ensure screenshot-basic
ensure spawnbase

Order matters: screenshot-basic must start before spawnbase.

  1. Your script calls takeImage (client) or takeServerImage (server).
  2. The spawnbase server mints a one-shot presigned URL — your API token never leaves the server.
  3. The client calls screenshot-basic’s requestScreenshotUpload(url, "file", callback, encoding, quality) with that URL. The form field name is file, matching the upload endpoint.
  4. screenshot-basic captures and POSTs the image directly; the response envelope ({ status: "ok", data: { url } }) is what the export resolves with.

Encoding and quality come from config.json (logs.capture.encoding, logs.capture.quality; defaults png, 0.9).

  • takeServerImage always times out — screenshot-basic isn’t started, starts after spawnbase, or the target player’s client is blocked (loading screen/mod menu). Raise logs.capture.timeoutMs.
  • Uploads 401 — the presigned URL expired before the capture (slow client); URLs live 5 minutes and are single-use, so a retry must mint a fresh one — the SDK does this per call.
  • Black screenshots — a known screenshot-basic/game issue with some overlays; not something the SDK can fix. Test with a plain client first.