Skip to main content
The FiveMesh SDK screenshot helpers already use CitizenFX’s screenshot-basic resource to capture in-game screenshots and upload them through the server.

Prerequisites

Capture and upload through the SDK

In server.cfg, start screenshot-basic before the SDK. Start any resource that calls the SDK after both.
Use takeServerImage to capture a specific player from server Lua, or takeImage to capture the local player from client Lua. Both exports upload through the SDK server resource and return object.publicUrl on success. See the SDK screenshot reference for complete examples and options.

Use a scoped URL with an existing upload flow

If your script already calls requestScreenshotUpload, pass it a scoped upload URL. The short overload takes a URL, a multipart field name and a callback. In your server script, call this function from a workflow that already authorizes the capture. Pass the server ID of the client that should take the screenshot.
In your client script, use the same event name. CitizenFX’s short overload produces a JPEG. The client receives the upload URL and sends the file under file.
Keep the API key on the server. Issue a fresh upload URL for each capture and send it only to the client taking the screenshot.

Verify uploads

Trigger one capture and check for the screenshot under screenshots in the CDN object browser. Open the public URL from the result. If the upload URL has expired or already accepted a file, request a fresh URL. If you change the screenshot encoding, also update the MIME allow-list to match.