Exports
All server-side exports are called as exports['tosun-ac']:FunctionName(...) from your other scripts. Below are all functions grouped, with usage examples.
1. Whitelist / Exemption
Exempts a player from AC bans/kicks.
-- Permanent (until server restart)
exports['tosun-ac']:AddWhitelist("license:abc123")
-- Temporary (seconds) — server ID or license/discord/steam
exports['tosun-ac']:AddWhitelist(12, 300) -- 5 minutes
exports['tosun-ac']:RemoveWhitelist(12)
local ok = exports['tosun-ac']:IsWhitelisted(source) -- boolean
2. Area / activity-based exemption
Exempts only for the duration of an activity (parkour, clothing store, mission).
exports['tosun-ac']:WhitelistArea(source, "parkour", 60) -- 60s
exports['tosun-ac']:ClearArea(source, "parkour") -- clear when done
local inArea = exports['tosun-ac']:IsInArea(source, "parkour")
3. Per-detection bypass
Disables only a specific detection briefly instead of all of them.
exports['tosun-ac']:BypassDetection(source, "antiTeleport", 5000)
exports['tosun-ac']:BypassDetection(source, { "antiTeleport", "antiNoClip" }, 8000)
Detection keys: antiTeleport, antiNoClip, antiFastRun, antiGodMode, antiAimbot, antiSilentAim, antiInvisible, antiSpectate, antiEntitySpawn… (full list: panel → AC Settings).
4. General exemption (max 5 min)
exports['tosun-ac']:SetPlayerExempt(source, true, 30000, "clothing")
exports['tosun-ac']:SetPlayerExempt(source, false, 0, "clothing")
exports['tosun-ac']:PauseAllDetections(15000) -- ALL players (restart/event)
exports['tosun-ac']:PausePlayerDetections(source, 15000) -- single player
5. Admin checks
if exports['tosun-ac']:isAdmin(source) then ... end
local t = exports['tosun-ac']:getAdminType(source) -- "tx" | "config" | false
local prot = exports['tosun-ac']:IsPlayerProtected(source) -- admin OR whitelist
exports['tosun-ac']:addAdmin(source) -- add runtime admin
6. Player info
local info = exports['tosun-ac']:GetPlayerInfo(source)
-- { id, name, ping, license, discord, steam, citizenid, isAdmin, coords, endpoint }
local all = exports['tosun-ac']:getOnlinePlayers() -- all online summary
local near = exports['tosun-ac']:GetNearbyPlayers(source, 30.0)
7. Ban / detection records
local bans = exports['tosun-ac']:getBans(100, 0)
local ban = exports['tosun-ac']:getBanInfo(banID)
local last = exports['tosun-ac']:GetDetections(source, 5)
8. Manual kick / ban
exports['tosun-ac']:KickPlayer(target, "Reason")
exports['tosun-ac']:BanPlayerExt(target, "Trolling") -- AC ban pipeline (DB+log)
exports['tosun-ac']:ban(target, "Reason") -- legacy name
9. Honeypot / fake trigger
-- Prevent your own event from hitting the honeypot (legit event)
exports['tosun-ac']:fakeTriggerWhitelist("mybank:deposit")
-- Turn an event into a trap (whoever triggers it gets banned)
exports['tosun-ac']:fakeTriggerTrap("admin:giveMoney", "server")
10. Status / Forensics
local s = exports['tosun-ac']:GetStatus() -- { version, online, detections, debug, framework }
exports['tosun-ac']:refreshPanelWhitelist()
local alts = exports['tosun-ac']:ForensicLinksOf("abc123") -- alt-account/ban-evasion graph (v17)
Practical scenarios
-- Clothing store
RegisterNetEvent("clothing:start", function() exports['tosun-ac']:SetPlayerExempt(source, true, 60000, "clothing") end)
RegisterNetEvent("clothing:done", function() exports['tosun-ac']:SetPlayerExempt(source, false, 0, "clothing") end)
-- Parkour minigame (only disable teleport+fastrun)
exports['tosun-ac']:BypassDetection(source, { "antiTeleport","antiFastRun","antiSuperJump" }, 120000)
-- Helicopter delivery (area-based)
RegisterNetEvent("missions:start", function(id) exports['tosun-ac']:WhitelistArea(source, "mission_"..id, 600) end)
AddWhitelistis runtime — resets on restart. For permanent: panel → AC → Whitelist.durationMsmax 5 min (SetPlayerExempt / PauseAllDetections / PausePlayerDetections). For longer use WhitelistArea/AddWhitelist (seconds).KickPlayer/BanPlayerExtmust only be called from trusted server scripts (not triggered by a client event).- Multichar: after character select call
TriggerServerEvent('tosun-ac:panel:characterReady').
11. Client-side events
Some exemptions can also be triggered from the client (for client scripts that have no export access).
-- Request a temporary exemption from the client (ms, not seconds; max 5 min)
TriggerServerEvent('ts_anticheat:requestExempt', 15000, "my_minigame")
-- Multichar: when character selection finishes
TriggerServerEvent('tosun-ac:panel:characterReady')
Parameter formats
idOrLicense:serverId(number) or string —license:xxx,discord:xxx,steam:xxx,citizeniddurationSec: seconds (Whitelist/Area) ·durationMs: milliseconds, max 300000 (5 min) (Exempt/Pause)detectionKey: single string or array ({ "antiTeleport", "antiNoClip" })
Quick reference
| Function | Purpose |
|---|---|
AddWhitelist / RemoveWhitelist / IsWhitelisted | Permanent/temporary exemption |
WhitelistArea / ClearArea / IsInArea | Activity-based exemption |
BypassDetection | Disable one detection briefly |
SetPlayerExempt / PauseAllDetections / PausePlayerDetections | General exemption (max 5 min) |
isAdmin / getAdminType / IsPlayerProtected / addAdmin | Permission checks |
GetPlayerInfo / getOnlinePlayers / GetNearbyPlayers | Player info |
getBans / getBanInfo / GetDetections | Ban/detection records |
KickPlayer / BanPlayerExt / ban | Manual kick/ban |
fakeTriggerWhitelist / fakeTriggerTrap | Honeypot |
GetStatus / refreshPanelWhitelist / ForensicLinksOf | Status / forensics |
Quick console test: exports.tosun-ac:isAdmin(1) · exports.tosun-ac:GetPlayerInfo(1)