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-basicensure spawnbaseOrder matters: screenshot-basic must start before spawnbase.
How capture works
Section titled “How capture works”- Your script calls
takeImage(client) ortakeServerImage(server). - The
spawnbaseserver mints a one-shot presigned URL — your API token never leaves the server. - The client calls screenshot-basic’s
requestScreenshotUpload(url, "file", callback, encoding, quality)with that URL. The form field name isfile, matching the upload endpoint. - 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).
Troubleshooting
Section titled “Troubleshooting”takeServerImagealways times out — screenshot-basic isn’t started, starts afterspawnbase, or the target player’s client is blocked (loading screen/mod menu). Raiselogs.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.