screenshot-basic for FiveM
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.
At a glance
| Maintainer | Cfx.re |
| Latest release | Rolling — no tagged releases |
| Last code change | 2023-02-08 |
| Licence | MIT |
| Written in | TypeScript |
| GitHub stars | 136 |
| Status | Active |
| Installed on | 51% 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. Drop it in and ensure it
No dependencies, no config.
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. 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.