Configuration

The Shield protects your server out of the box. You only touch the configuration to fit it to your server: framework, staff, your own scripts, and the weapons and vehicles your server uses.

Panel or file?

  • Action of each protection (off, warn, block, kick, ban): change it in Protections, on the panel.
  • Day-to-day settings (mode, language, speed, weapon damage and range, trusted resources, allowed models): change them in Config, on the panel.
  • What only exists in the file (license, framework, connection locks, advanced settings): the config/ folder.

When the two say different things, the panel wins.

What applies without a restart

FileSectionWhen it applies
config/config.luaPermissions (roles, staff, bypass)10 seconds after saving
config/allowlist.luaidentifiers, resources, events, models, blipSprites, overrides10 seconds after saving
config/blacklists.luaall lists and the enforce... keys10 seconds after saving
Everything elseConfig, Bridge, Connection, config/detections.lua, stateBagKeysrestart mengazo-shield

The console confirms with reloaded without a restart. To apply it right away, without waiting the 10 seconds:

Console
shield_reload

A file saved with a syntax error breaks nothing: the Shield keeps the previous version and warns in the console.


config/config.lua

License, language and log

Lua
Config.License = {
	key = "MENGAZO-XXXX-XXXX-XXXX",
	authToken = "",
}

Config.Debug = false       -- true = detailed log in the console
Config.Locale = "pt-BR"    -- "pt-BR", "en" or "es"
  • The language applies to the ban and kick screens, the console, the staff alerts and /shield.
  • Language order: the one chosen on the panel, then the convar, then the file.
  • You can turn on the log and set the language from server.cfg, without editing the file:
server.cfg
set mengazo_shield_debug true
set mengazo_shield_locale "en"

Operating mode

Lua
Config.Mode = {
	state = "enforce",            -- "enforce" applies the actions; "monitor" only logs
	pushRulesFromBackend = true,  -- accepts what you change on the panel
}
  • enforce is the default. The server starts protected, with no learning period.
  • monitor logs everything and punishes no one. It is meant for diagnosis.
  • Quick switch from the console: shield_mode monitor or shield_mode enforce.

Framework and player ID

Lua
Bridge.framework = "auto"   -- "auto" | "vrp" | "esx" | "qbcore" | "qbox" | "standalone" | "custom"

With "auto" the Shield finds the framework and the player's official ID (passport, user_id, citizenid) on its own. That ID shows up in alerts, logs and on the panel.

Custom framework:

Lua
Bridge.getPlayerId = function(source)
	return exports["meu_framework"]:getUserId(source)   -- must answer right away, without a database query
end
Bridge.playerIdLabel = "Passaporte"   -- how the ID is shown

Or provide it from your script, at login. See Script integration.

Your server's action names

The Shield recognizes a legitimate action by what your script's server side sends to the player. It already knows the common names (setArmour, setHealth, revive, teleport...). If your script uses another name, teach it here:

Lua
Bridge.pushKinds = {
	darcolete = "armour",    -- name of the event or Tunnel function, in lowercase
	curar     = "heal",
	dardroga  = "movemod",
	energetico = "stamina",
	irpara    = "teleport",
}

Accepted values: "armour", "heal", "movemod", "stamina", "teleport".

Companion in the resources

Lua
Config.AutoInject = {
	enabled = true,       -- false = the boot neither checks nor installs
	autoInstall = true,   -- false = the boot only warns; installing is done with shield_install
	scanDelayMs = 8000,
	exclude = {
		"meu_script_sensivel",   -- resource that should not get the companion
	},
}

Connection locks

Lua
Connection = {
	enabled = true,

	hwidBan = {
		enabled = true,        -- a new account on a banned player's PC is banned too
		minTokenMatches = 1,
	},

	name = {
		enabled = true,
		reason = "Seu nome contém termos não permitidos. Ajuste e reconecte.",
		patterns = { "eulen", "redengine" },   -- banned terms in the name, in lowercase
		blockHidden = true,                    -- blocks invisible characters in the name
		hiddenReason = "Seu nome contém caracteres ocultos não permitidos.",
	},

	vpn = {
		enabled = false,   -- uses an external API and delays the connection
		reason = "Detectamos VPN/proxy. Desative para entrar.",
	},

	chat = {
		enabled = true,
		patterns = { "compre cheat" },   -- terms blocked in chat, in lowercase
	},
}

Bait events

The Shield registers fake events on every boot. No script on your server knows their names. Whoever triggers one of them is firing events blindly.

Lua
Config.Honeypot = {
	enabled = true,
	count = 4,   -- baits per boot, from 1 to 12
	names = {
		"vrp_bank:transfer", "vrp_inventory:giveItem", "vrp_garage:spawnVehicle",
	},
	static = {
		-- "meu_evento_isca",
	},
}
  • names is only the disguise. On an ESX or QBCore server, replace them with your framework's prefix.
  • static are baits with a fixed name. Only list a name that no script uses.
Lua
Config.MenuTrap = {
	enabled = true,
	action = "score",   -- "score" adds suspicion; "kick" kicks the player
	events = {
		-- "nome_do_evento_do_menu",
	},
}

Only list event names you have confirmed belong to a cheat menu.

Silenced agent

Lua
Config.Integrity = {
	onTamperAction = "warn",        -- "warn" | "block" | "kick" | "ban"
	tamperActionAfterReports = 2,
	-- other keys: keep the default
}

This is the action taken when the Shield's client side stops answering for a sustained period. Start with "warn". After a few days with no false alerts, "kick" is the recommended value.

Deferred ban

Lua
Config.DeferredBan = {
	enabled = false,
	minMinutes = 120,
	maxMinutes = 720,
	signals = { "UNREGISTERED_EVENT_CALL", "IMPOSSIBLE_EVENT_ARGS" },
}

When it is on, the ban for these detections goes out hours later, in a batch, so the cheat cannot find out what was caught. The panel has the same setting. shield_deferred_bans lists the queue.

Discord alerts and map

Lua
Config.Alerts = {
	discordWebhook = "",    -- optional; the panel's channels cover the usual cases
	notifyOnSeverity = 4,   -- minimum severity to alert, from 1 to 5
}

Config.Map = {
	-- server with its own map: the image and the world coordinates at its edges
	-- image = "https://exemplo.com/mapa.webp",
	-- calibration = { WIDTH = 2000, HEIGHT = 2814, LEFT = -4230, RIGHT = 4530, TOP = 8020, BOTTOM = -4300 },
}

Event call limits

It is turned on by the Event call abuse row in Protections. The file holds the limits:

Lua
Config.RemoteGate = {
	maxCalls = 30,        -- calls per event, per player, within the window
	burst = 10,
	windowMs = 10000,
	-- ...

	tokenExempt = {},     -- see below
	joinGraceMs = 180000, -- join margin: during this time the session mark never kicks or bans

	overrides = {
		-- legitimate event that calls a lot: give it its own limit
		["inventory"] = {
			["inventory:tunnel_req"] = {
				members = { refresh = { maxCalls = 100, burst = 20, maxConcurrent = 8 } },
			},
		},
		["meu_hud"] = {
			["meu_hud:atualizar"] = { maxCalls = 120, burst = 30 },
		},
	},
}
  • shield_gate in the console shows, per resource and event, how many calls and refusals there were, and suggests a ready-made overrides.
  • Going over the limit is about pace, not suspicion: the call is refused and nothing goes to Blocks. Only a sustained excess becomes a record.
  • tokenExempt: list here the resource that receives events coming from another resource's JavaScript client. It is the only case the Shield does not notice on its own. Example: tokenExempt = { "minha_resource" }.

To take a resource out of the limit, or leave it only logging, use its manifest:

Lua
shield_gate 'audit'   -- 'enforce' (default) | 'audit' (only logs) | 'off'

Diagnostics

Lua
Config.Diagnostics = {
	dryRun = false,          -- true = shows what would be deleted, without deleting
	dryRunWindowMin = 0,     -- minutes until it turns back on by itself (0 = manual)
	observeResources = {},   -- observe only these resources (empty = all)
}

It is easier from the console: shield_dryrun on 15 minha_resource and shield_dryrun off.

What you do not need to touch

Config.Model, Config.Performance, Config.Capacity, Config.FalsePositive, Config.ClientResourceWatch and Config.BanPurge already come tuned. Hardening is only the list of recommendations from shield_platform_audit: changing it does not change the server.


config/detections.lua

Action of each protection

The Detections table holds the factory default for each protection. Change the action on the panel, in Protections: it applies within a minute, with no restart.

Your server's sensitive events

Per-player limit for inventory, bank and shop events:

Lua
SensitiveEvents = {
	["bank:transfer"] = {
		maxPerInterval = 5, intervalMs = 10000,   -- at most 5 every 10 s
		validate = "positiveAmount",              -- refuses a zero, negative or above-possible-balance amount
		onViolation = "ECONOMY_RATE",             -- protection that records the abuse
	},

	["shop:buyItem"] = {
		maxPerInterval = 20, intervalMs = 5000,
		validate = "positiveAmount",
		onViolation = "ECONOMY_RATE",
	},
}

The three examples that come in the file are generic. Replace them with your server's event names.

Healing, armor and ped change

Lua
PlayerStateGuards = {
	enabled = true,
	healGraceMs = 4000,
	armourGraceMs = 4000,

	-- YOUR server's network events that heal or give armor
	healEvents = { "hospital:heal" },
	armourEvents = { "policia:colete" },

	-- models for which the change is never suspicious
	neutralPeds = { "mp_m_freemode_01", "mp_f_freemode_01" },

	-- YOUR server's events that change the ped (character selector, ped shop)
	pedEvents = { "personagem:trocarPed" },
	pedGraceMs = 15000,
}

Listing the event here is the simplest way and also the weakest: whoever triggers the event opens the window. The strong way is for the script to tell the Shield from the server. See Script integration.

Health, armor and damage read on the server

Lua
SyncGuards = {
	enabled = true,
	intervalMs = 2000,
	confirmSamples = 2,
	maxWeaponDamageModifier = 1.5,    -- a server that raises damage by job needs to raise this
	minWeaponDefenseModifier = 0.5,
	maxHealth = 200,                  -- a server with higher max health needs to raise this
	maxArmour = 100,
	superJump = true,
}

Protected resources

Stopping one of these from the client triggers a detection. The Shield already protects itself.

Lua
ProtectedResources = {
	"mengazo_shield",
	"spawnmanager",
	"vrp",
}

Evidence screenshot and video

Lua
Evidence = {
	enabled = true,
	minSeverityForShot = 4,       -- minimum severity to take a screenshot
	videoSignals = {
		-- MOVEMENT_SPEED = false, -- turns off the video for this detection
	},
	video = { seconds = 12 },     -- seconds recorded before the detection
	recordAboveScore = 15,
	cooldownMs = 20000,           -- one capture per player every 20 s
}

Video quality has a fixed cap (360p, 20 fps) so it does not weigh on the player's FPS. You can lower it, but not raise it.

Advanced settings

Some tables do not come in the file: WeaponGuards, WeaponAuthority, AttachGuards, ConfirmPolicy, SpawnGuards, VehicleGuards and others. To change a value, declare only what you want to change at the end of config/detections.lua. The rest keeps the default.

Lua
WeaponGuards = { maxDamage = 900 }                          -- body damage cap (default 800)
AttachGuards = { remoteAttachmentSanitization = true }      -- refuses attaching an entity to another player's ped
ConfirmPolicy = { sustainedSecondChain = true }             -- noclip only acts the 2nd time within 30 s

To go back to the default, delete the line.


config/allowlist.lua

Your server's exceptions. Volume limits (number of spawns, of calls) still apply to everyone.

Lua
Allowlist = {

	-- trusted resources: whatever comes from them does not trigger a detection
	resources = {
		"es_extended", "qb-core", "ox_inventory", "ox_lib",
		"meu_core",
	},

	-- sensitive events that should not be limited
	events = {
		"meu_core:sincronizar",
	},

	-- models your server uses that would be on the blacklist
	models = {
		"hydra", "stt_prop_stunt_tube_s",
	},

	-- blip sprites your server's scripts attach to players (faction radar, police GPS)
	blipSprites = { 9, 225 },

	-- state bag keys a client script writes many times; accepts a prefix with *
	stateBagKeys = { "tl_spectate_cam", "minigame_*" },

	-- your server's limits
	overrides = {
		maxGroundSpeed = 9.0,     -- m/s on foot
		maxVehicleSpeed = 75.0,   -- m/s in a vehicle

		-- your server's BASE weapon damage (addon weapon or weapon changed in weapons.meta)
		weaponDamage = {
			WEAPON_FN_FAL = 60,
			[3205289012] = 44,   -- weapon with no known name: use the hash, without quotes
			default = 100,       -- addon weapon that is not in the list
		},

		-- weapon range, in meters
		weaponRanges = {
			WEAPON_HEAVYSNIPER_MK2 = 1800,
			default = 400,
		},
	},

	-- players exempt by identifier; prefer the panel's Bypass page, which has an expiry
	identifiers = {
		-- "license:0000000000000000000000000000000000000000",
	},
}

Be careful:

  • A trusted resource is the broadest exception there is. Only list your own resources or ones from a vendor you trust. A script with a poorly protected event, if trusted, becomes a way in.
  • Before raising a limit, measure. shield_calibration shows what your server actually does against each limit and suggests the adjustment.
  • resources, models, blipSprites, stateBagKeys, speed, damage and range also exist in Config, on the panel. What is on the panel overrides the file.

config/blacklists.lua

Lua
Blacklists = {

	-- objects used to crash or disrupt players; always active
	crasherObjects = { "prop_windmill_01", "p_cablecar_s" },

	-- peds that only show up through a menu or script
	enforcePeds = true,
	exploitPeds = { "a_c_chimp", "cs_michael" },

	-- military and grief vehicles
	enforceVehicles = true,
	griefVehicles = { "hydra", "lazer", "rhino", "oppressor2" },

	-- shots from these weapons cause no damage and flag the shooter
	damageWeapons = { "WEAPON_RAILGUN", "WEAPON_MINIGUN" },

	-- these projectiles are not fired and the shooter is flagged
	projectileWeapons = { "WEAPON_HOMINGLAUNCHER" },

	-- weapons NO player may have: removed from the hand at once and whoever held it is flagged
	playerWeapons = { "WEAPON_RPG", "WEAPON_RAYPISTOL" },

	-- an NPC with these weapons is deleted
	enforceNpcWeapons = true,
	npcWeapons = { "WEAPON_RPG", "WEAPON_MINIGUN" },

	-- blocked vehicle weapons
	vehicleWeapons = { "VEHICLE_WEAPON_TANK" },
}

return Blacklists

The file already comes with the full lists. The snippets above only show the format.

Common cases:

  • Your server uses a vehicle from the list (for example the police with rhino): remove the model from griefVehicles, or put it in Allowlist.models.
  • Your server has no vehicle or ped restrictions: enforceVehicles = false or enforcePeds = false.
  • A banned weapon is allowed for one player (event, staff): the script calls allowWeapon. See Script integration.
  • A list you delete from the file does not become empty: the Shield keeps the one that was in use.

config/verdicts.lua

Combinations of detections that become a new detection. It comes turned off (VerdictPolicy = { enabled = false }). Leave it as it is, unless support tells you otherwise.