ApexDocs
Developers

Report to Apex

Send your own detections into the Apex pipeline, protect your events with tokens and read session info.

Flag a player from your script#

Found something suspicious in your own resource (a trigger that should never fire, impossible money, a blacklisted item)? Hand it to Apex. It goes through the normal pipeline: logged, shown in the dashboard and punished according to the detection's settings.

lua
-- server-side
TriggerEvent('apex:ext:flag', source, 'antiEventSpoof', 'myshop: bought item for $0')
Argument Description
source The player.
detectionName An existing detection name (see the list). Empty → antiEventSpoof. The action (ban/kick/warn) comes from that detection's settings in your dashboard.
detail Free text shown in the logs and evidence.

There is also a shortcut export that always uses antiEventSpoof (default action: warn):

lua
exports['ApexAC']:Flag(source, 'myshop', 'bought item for $0')

Protected events (token + rate limit)#

Apex can protect your own server events against executors that fire them directly. The client sends the event through Apex, which adds a rotating per-player token; the server verifies it.

lua
-- client
exports['ApexAC']:Trigger('myshop:buy', itemName, amount)
lua
-- server
RegisterNetEvent('myshop:buy', function(token, itemName, amount)
    local src = source
    if not exports['ApexAC']:Verify(src, token, 'myshop:buy', { rate = { 10, 1000 } }) then
        return   -- invalid token or too many calls: Apex already flagged it
    end
    -- ... handle the purchase
end)
  • The first argument your handler receives is the token.
  • rate = { limit, windowMs } — set your own limit per event.
  • An invalid token or exceeding the rate limit flags antiEventSpoof.

Check a detection's action#

lua
local action = exports['ApexAC']:apexDetActionFor('antiNoclip') -- 'ban' | 'kick' | 'warn' | nil

nil means the detection is disabled (or the licence is a trial, which never punishes).

Session info#

lua
local info = exports['ApexAC']:GetSessionInfo(source)
-- info.name, info.ip, info.state, info.connectedAt, info.spawnedAt,
-- info.lastHeartbeat, info.activityCount, info.flagged, info.whitelisted