Santa & Christmas Edition36 maps, limited runlimited runShop the drop
Utility · Cfx.re

screenshot-basic for FiveM

What it is

The official Cfx.re resource for taking a screenshot of the game and uploading it — the backbone of every in-game camera, report and evidence system.

screenshot-basic is a small official resource that does one thing: capture the game's frame buffer and hand it back as a data URL or POST it to a URL you choose. Everything that photographs the game on a FiveM server — phone cameras, ban evidence, report attachments, Discord logs — is built on it.

Official documentation Repository All resources

At a glance

MaintainerCfx.re
Latest releaseRolling — no tagged releases
Last code change2023-02-08
LicenceMIT
Written inTypeScript
GitHub stars136
StatusActive
Installed on51% of the 1,000 busiest servers · census, 2026-11-30

Figures read from the repository on 2026-09-22.

Why servers run it

  • Official, tiny and maintained by Cfx.re rather than by a community fork.
  • Can return a base64 data URL to NUI or upload straight to a webhook or an API.
  • Handles the awkward part — reading the game's back buffer — so you do not have to.

Installing screenshot-basic

  1. 1. Drop it in and ensure it

    No dependencies, no config.

  2. 2. Decide where images go

    A Discord webhook is the easy answer; your own endpoint is the right one if you care about the images surviving.

  3. 3. Rate limit it yourself

    The resource will happily screenshot as fast as you ask. Anything player-triggered needs a cooldown on the server.

Working examples

Capturing and posting to a Discord webhook

-- client
exports['screenshot-basic']:requestScreenshotUpload(
    'https://discord.com/api/webhooks/xxx/yyy', 'files[]', function(data)
        local resp = json.decode(data)
        TriggerServerEvent('myserver:screenshotTaken', resp.attachments[1].url)
    end)

Getting a data URL back into NUI

exports['screenshot-basic']:requestScreenshot({
    encoding = 'jpg',
    quality = 0.85,
}, function(data)
    SendNUIMessage({ action = 'photo', src = data })  -- data is a data: URL
end)

What goes wrong

It captures the game, not the NUI layer. Your HUD and your loading screen are not in the shot, which is usually what you want and occasionally not.

Webhook URLs in client scripts are public. Anybody can read them out of your client bundle and spam your Discord. Upload through your server instead.

Large PNGs are slow. JPEG at 0.8–0.9 quality is a tenth of the size and indistinguishable for evidence.

No built-in cooldown. A player-triggered screenshot with no server-side rate limit is a denial-of-service on your own webhook.

screenshot-basic — questions people ask

Can screenshot-basic capture the loading screen?
No. It captures the game's render target; NUI layers such as a loading screen or a HUD are composited separately and do not appear.
Is it safe to put a Discord webhook in a client script?
No. Treat every client file as public. Send the image to your own server endpoint and let the server post it.

Runs alongside

ox_lib

The shared library half the modern FiveM ecosystem depends on: menus, notifications, progress bars, zones, callbacks and a cache.

txAdmin

The web panel bundled with every FXServer build: process management, recipes, players, bans, scheduled restarts and live console.