Skip to main content

Developers

Server exports return one value, usually { ok = true, ... } or { ok = false, error = '...' }, so they work from Lua and JS.

Server exports​

-- create a report, for example from a phone app or an anticheat
local res = exports['gs-report']:CreateReport({
title = 'Speed hacking',
description = 'Teleported twice near the airport.',
priority = 'high', -- critical, high, medium or low
category = 'cheating', -- optional, a topic id
evidence = 'https://example.com/clip',
reporterSrc = src, -- or reporterIdentifier and reporterName
reportedSrc = targetSrc, -- or reportedIdentifier and reportedName
enforce = false, -- true applies the anti-abuse limits
})
-- { ok = true, id = 148 } or { ok = false, error = 'cooldown', retryIn = 80 }

exports['gs-report']:AddReportMessage(148, 'Support Bot', 'staff', 'We are looking into it.')
exports['gs-report']:UpdateReport(148, 'claim', 'Support Bot')
exports['gs-report']:UpdateReport(148, 'priority', 'Support Bot', { priority = 'critical' })
-- operations: claim, snooze, close, reopen, priority, status, assign, title, duplicate, abuse

exports['gs-report']:GetReport(148) -- { report, messages, timeline } or nil
exports['gs-report']:GetPlayerReports(identifier)
exports['gs-report']:AddPlayerNote(identifier, 'Name', 'Text', 'high', 'Added by')
exports['gs-report']:IsStaff(src)
exports['gs-report']:GetReporterTrust(identifier)
exports['gs-report']:CanFileReport(src)

exports['gs-report']:SetAdminDuty(src, true)
exports['gs-report']:IsAdminOnDuty(src)
exports['gs-report']:SetReportTags(148, { 'bug', 'needs-dev' }, 'Support Bot')

-- add a row to the player panel
exports['gs-report']:RegisterCustomData('Phone', function(src, identifier) return '555-0100' end)

Client exports​

exports['gs-report']:OpenReportMenu() -- the player side
exports['gs-report']:OpenStaffMenu() -- the staff side (the server checks permission)
exports['gs-report']:OpenReport(148) -- open a specific report

From the server you can open a page on a player's screen:

TriggerClientEvent('gs-report:openUI', src, 'player', { view = 'warnings' })
TriggerClientEvent('gs-report:openUI', src, 'staff', { view = 'inbox', selected = 148 })

Player pages: home, new, mine, warnings, appeal, settings. Staff pages: overview, inbox, analytics, moderation, library, notes, chat, categories, settings.

Server events​

EventArguments
gs-report:reportCreatedid, { title, priority, reporter, reported, category, source }
gs-report:reportUpdatedid, op, byName
gs-report:reportMessageid, authorName, role, body, hidden
gs-report:warnIssuedidentifier, reason, severity, byName, reportId
gs-report:banIssuedidentifier, reason, minutes, byName, reportId
gs-report:appealCreatedkind, id, playerName
gs-report:appealReviewedkind, id, status, byName
gs-report:dutyChangedsrc, onDuty
gs-report:moderationbyName, action, targetSrc, reason, reportId

gs-report:moderation fires for every staff action, so it's the place to hook your own admin tools:

AddEventHandler('gs-report:moderation', function(by, action, targetSrc, reason, reportId)
if action == 'mute' and targetSrc > 0 then exports['my-voice']:MutePlayer(targetSrc) end
end)

Frameworks​

FrameworkPlayer identifierStaff check
ESXxPlayer.identifierConfig.StaffGroups.esx
QBCorecitizenidConfig.StaffGroups.qbcore
QboxcitizenidConfig.StaffGroups.qbox
Standalonelicense:ACE permission only