Documentation / Screen recording

Screen recording

Record video or take snapshots of the player and upload them to Discord from the server.

Adictos_WebLogs includes a built-in ScreenRecord module: it captures the client’s screen via NUI (WebGL/MediaRecorder), sends the video to the server and uploads it to Discord through the panel proxy. Ideal for anticheat, staff reports or evidence in logs.

Requirements

  • ScreenRecord webhook under My servers → Web logs (active + Discord URL). The screenrecord category is fixed and is no longer edited under Categories.
  • Correct Config.WebsiteURL (the server uploads the video via screenrecord-upload.php).

recordPlayerScreen export

Records a WebM video of the player’s screen and returns the Discord URL in the callback:

exports['Adictos_WebLogs']:recordPlayerScreen(source, durationMs, function(success, urlOrError)
    if success then
        print('Video subido: ' .. urlOrError)
        -- urlOrError = URL del attachment en Discord
    else
        print('Error: ' .. tostring(urlOrError))
    end
end, 'Motivo de la grabación')

-- durationMs: por defecto Config.ScreenRecord.DefaultDuration (10000)
-- Máximo: Config.ScreenRecord.MaxDuration (30000)

capturePlayerSnapshot export

Captures an instant JPEG image (lighter than a video):

exports['Adictos_WebLogs']:capturePlayerSnapshot(source, function(success, urlOrError)
    if success then
        print('Snapshot: ' .. urlOrError)
    end
end, 'Evidencia anticheat')

Other useful exports

ExportUse
isScreenRecordReady()true if there is a webhook and it is active
getScreenRecordStatus()ready, reason (message if not ready)
stopPlayerRecording(src)Stops a recording in progress
isPlayerBeingRecorded(src)Returns whether the player is being recorded
spectatePlayer(adminSrc, targetSrc)Live spectate (relay to the web panel)
stopSpectating(adminSrc)Stops spectating

Console / staff commands

/record <player_id> [duracion_seg] [motivo]
/spectate <admin_id> <target_id>
/spectate <admin_id> stop

Use in logs

If you include the video field (duration in milliseconds) together with the player’s server_id when logging, WebLogs automatically records their screen before sending the log to the panel. There is no need to call recordPlayerScreen separately.

exports['Adictos_WebLogs']:Log('anticheat', 'detection', {
    license = licenseClean,
    playerName = name,
    server_id = source,   -- obligatorio para saber a quién grabar
    video = 10000,        -- duración en ms (10 segundos)
    reason = 'Noclip detectado',
}, true)

The internal flow is as follows:

  1. 1WebLogs detects video and starts recording the player given in server_id.
  2. 2The client captures the screen and sends the video to the FiveM server.
  3. 3FiveM uploads it to Discord through the Web logs ScreenRecord webhook (panel proxy: screenrecord-upload.php).
  4. 4Discord returns the attachment URL (Discord CDN).
  5. 5That URL is stored in video_url and the log is sent to the panel with the link to the video.
No webhook, no video. Configure ScreenRecord under My servers → Web logs (webhook + active). The video is stored on Discord; the panel only stores the link (video_url).

Configuration

Adjust resolution, FPS, maximum duration and quality in config.lua → Config.ScreenRecord. The client uses client/config_client.lua only for spectate visual settings.

Recording requires the player to have the client active and the NUI loaded. If it fails, check the server console ([ScreenRecord]) and that the category webhook is configured.