Skip to content

Integration and np_guard ​

Authoritative receipts ​

Place receipts next to an accepted server action, using server-resolved values. A receipt grants a bounded allowance, not a resource-wide bypass.

lua
exports.np_anticheat:expectTeleport(src, { to = destination, radius = 8, ignoreZ = false }, 5000)
exports.np_anticheat:expectEntity(src, { model = model, count = 1 }, 5000) -- BEFORE creation
-- After the successful direct framework credit, with its exact reason/account:
exports.np_anticheat:expectMoney(src, amount, 'validated payout', 5000, 'money')
exports.np_anticheat:expectHeal(src, { treatment = 'revive' }, 8000)

Entity model strings and signed/unsigned hashes normalize to the same 32-bit model. Money receipts must match the successful direct credit amount, framework reason and account (money/cash, bank or black_money). Post them after success; np_banking ledger evidence covers bank credits and mirror reconciliation. Use teleport ignoreZ = true only when destination height is intentionally unavailable.

Vendor np_guard ​

Copy the canonical np_anticheat/lib/np_guard.lua byte-identically to your resource's bridge/np_guard.lua and load it after shared configuration, before handlers. The library works when the anticheat is stopped: local checks remain active and anticheat reports/receipts become no-ops.

lua
shared_script 'bridge/np_guard.lua'
lua
guard.net('my_resource:request', {
  schema = { 'int' },
  rate = { per = 2000, burst = 1 }, maxBytes = 64, lock = true,
  near = function(src, id) return ServerObjects[id].coords, 3.0 end,
}, function(src, id)
  -- Still authorize ownership, price, inventory and job state here.
end)
exports('npGuardStats', guard.stats)

Schemas support positional int, number, string:32, bool, coords, table, optional ?int and validator functions. near uses server ped distance and can also require matching routing buckets. guard.rpc(dispatcher, {eventName = 'resource:rpc'}) observes existing handler rejections; it does not retrofit a dispatcher's permission or cooldown checks. guard.receipt(kind, src, data) forwards accepted teleport/entity/money/heal receipts.

guard.serverOnly and guard.honeypot add decoy listeners after checking available guard inventories. Review names against actual raw handlers too. guard.coverage, guard.uncovered and guard.observeUnknown provide best-effort coverage observations; unknown does not mean malicious. guard.session/verifySession keep server tokens secret and do not prove client integrity. guard.nui validates client input but consequential server actions still need validation.

Existing resource observations ​

np_admin supplies staff state, moderation, screenshots, audit and the page host. np_net metrics and npGuardStats snapshots support event-cost views. ESX money events, np_banking transaction metadata and np_inventory item-added/item-removed/itemLog data provide economy evidence.

Travel/entity/heal adapters listen for candidate events from housing, doors, prison, transport, jobs, garages, dealership, impound, prop/NPC handlers and health resources. Verify the deployed event shape and authoritative timing. Post-spawn observations cannot replace a pre-creation receipt. A configured resource name does not establish complete compatibility.