Skip to content

OnPlayerAuditViolation

The inventory audit found items the server cannot explain - return false to vouch for them.

The player holds amount of a guarded item class ([audit] guarded_categories: weapons, armour, ammunition) where the server’s records explain allowed, in [audit] strikes reports in a row - or used a consumable they never held (amount 1, allowed 0). Return false to vouch: the records take the amount and nothing happens. Anything else and the [audit] action follows - log (the default; the excess is then accepted, so it is judged once), kick or ban.

function OnPlayerAuditViolation(pid, class, amount, allowed)
-- ...
end
Parameter Type
pid number the player
class string the item class GUID (GetItemName names it)
amount number how many the player holds
allowed number how many the server’s records explain

false vouches for the items; anything else lets the [audit] action happen

function OnPlayerAuditViolation(pid, class, amount, allowed)
Log(string.format("audit: %s holds %d x %s, %d explained", GetPlayerName(pid), amount, GetItemName(class), allowed))
if GetPlayerData(pid, "event_loot") then return false end -- the event handed things out itself
end

GetPlayerAuditViolations · GivePlayerItem · GetPlayerInventory · the Accounts, admins, bans and the audit group of the index