ServerOps.ggbeta
Server OwnersFiveM / RedM

Screenshot uploads

Upload in-game screenshots from your FiveM or RedM server to ServerOps.

Screenshot uploads

This guide sets up automatic screenshot uploads on your FiveM or RedM server. When a player report comes in or a staff member flags something, a screenshot gets captured and uploaded to ServerOps where you can view, share, and attach it to a moderation case.

Before you start

  • Complete Getting your API token first. You will need a token with media:write scope.
  • Your server must have the screenshot-basic resource installed (it is free and widely used).

Installing screenshot-basic

If you do not already have it:

  1. Download screenshot-basic from the cfx.re release page.
  2. Extract the folder into your server's resources/ directory.
  3. Add ensure screenshot-basic to your server.cfg.
  4. Restart your server.

Setting up your token

Open your server.cfg file and add this line anywhere near the top:

set serverops_token "so_live_..."

Replace so_live_... with the token you created earlier. This keeps your token in one place and out of your Lua files.

Adding the upload script

Create a new resource folder, for example resources/serverops-screenshots/. Inside it, create two files:

fxmanifest.lua

fx_version 'cerulean'
game 'gta5'

server_scripts { 'server.lua' }

server.lua

local TOKEN = GetConvar("serverops_token", "")

-- Call this function any time you want to take and upload a screenshot.
-- playerId: the server ID of the player to screenshot
-- reason: a short note stored with the file (e.g. "ban appeal #42")
function UploadScreenshot(playerId, reason)
    exports["screenshot-basic"]:requestScreenshotUpload(
        "https://api.serverops.gg/v1/media/base64",
        "file",
        { headers = { Authorization = "Bearer " .. TOKEN } },
        function(rawData)
            local response = json.decode(rawData)
            if response and response.url then
                print("[ServerOps] Screenshot uploaded: " .. response.url)
                -- response.id  -> unique file ID
                -- response.url -> public CDN URL
            else
                print("[ServerOps] Upload failed: " .. tostring(rawData))
            end
        end
    )
end

-- Example: screenshot a player when an admin runs /screenshot [id]
RegisterCommand("screenshot", function(source, args)
    local targetId = tonumber(args[1])
    if not targetId then return end
    UploadScreenshot(targetId, "manual screenshot by admin")
end, true) -- true = admin only

Adding to your existing scripts

If you already have admin or moderation scripts, you can trigger a screenshot from within them. Just call UploadScreenshot(playerId, reason) wherever you want the capture to happen. For example, inside your ban handler:

-- Inside your existing ban function:
UploadScreenshot(playerId, "ban: " .. banReason)
BanPlayer(playerId, banReason)

Enabling the resource

Add this to your server.cfg:

ensure serverops-screenshots

Restart your server. Test it by running /screenshot [your server ID] in the console.

Viewing your uploads

Go to your dashboard to see all uploaded files. Each file has a CDN URL you can share with staff or attach to a case.

Troubleshooting

"Upload failed: nil": Your token is missing or wrong. Double-check the set serverops_token line in server.cfg.

screenshot-basic not found: Make sure ensure screenshot-basic is in your server.cfg and the resource folder name matches exactly.

Files appear in dashboard but URL is broken: The upload worked but your CDN may take a few seconds to propagate. Refresh the page.

On this page