Exports

Ban, unban, kick and control Codeon Shield from your own resources.


Every export is server-side. Call them from any server script with exports.CodeonShield:Name(...).

ExportReturnsWhat it does
BanPlayer(src, reason, _, staff)banIdBans an online player permanently (identifiers and hardware tokens) and kicks them.
OfflineBan(identifiers, reason, staff, name)banIdBans a player who is not connected. identifiers is one identifier ("license:...") or a list. Known identifiers of that player are added too.
UnbanId(banId)booleanRevokes a ban by its ID.
UnbanIdentifier(identifier)numberRevokes every ban that contains that identifier. Returns how many were removed.
IsBanned(src)booleanWhether a player matches an active ban.
GetPlayerBan(src)table | nilThe ban that matches a player (id, name, reason, staff, date, identifiers, detection, details).
GetBan(banId)table | nilA ban by its ID.
GetBans()tableEvery active ban.
KickPlayer(src, reason)booleanKicks a player with the Codeon Shield message.
Screenshot(src, function(image) end)booleanTakes a screenshot of the player's screen. image is a base64 JPEG, or nil if the player did not answer.
Detect(src, detection, details)booleanBans a player for a detection of your own resource, with the same evidence and webhooks as the anticheat. detection is a key like "anti_noclip".
AllowTeleport(src, ms)-Call it right before your script teleports a player, so teleport and noclip detections ignore it (8 s by default).
AllowHeal(src, ms)-Call it right before your script heals or revives a player (8 s by default).
AllowWeapon(src, ms)-Call it when your script gives a weapon outside the inventory, so Anti Weapon Spawn ignores it (60 s by default).
Exempt(src, detections, ms)booleanPauses one detection ("anti_noclip"), a list, or all of them (nil) for a player for some milliseconds (10 minutes at most).
IsStaff(src)booleanWhether the player is staff in your Codeon Shield permissions.
HasPermission(src, action)booleanWhether the player can use an action: kick, ban, unban, screenshot or bypass.
IsDetectionEnabled(detection)booleanWhether a detection is enabled in your configuration.
GetDetections()tableEvery detection with its name and whether it is enabled.
IsAuthenticated()booleanWhether the license is valid and the protection is running.

Examples

local banId = exports.CodeonShield:BanPlayer(source, "Dupe glitch", nil, "MyScript")

exports.CodeonShield:OfflineBan("license:2b8f1c0e...", "Chargeback")

if exports.CodeonShield:IsBanned(source) then
    local ban = exports.CodeonShield:GetPlayerBan(source)
    print(ban.id, ban.reason)
end

exports.CodeonShield:AllowTeleport(source)
SetEntityCoords(GetPlayerPed(source), 215.0, -810.0, 30.7)

exports.CodeonShield:Screenshot(source, function(image)
    if image then print("Screenshot taken") end
end)

Teleports, heals and revives

Teleports and heals done by txAdmin, the /bring command of ESX and QBCore (only for players with that command's permission), the qb-adminmenu bring and the teleport and revive events of ESX and QBCore are recognised automatically. If your own scripts teleport, heal or give weapons, call AllowTeleport, AllowHeal or AllowWeapon right before, or the anticheat will treat it as a cheat.