F.A.Q
Setup
No. The ml_turrets table is created automatically at first start through CREATE TABLE IF NOT EXISTS. Later starts leave the existing table in place.
oxmysql cannot reach your database. Check the connection string in your server config. The script refuses to start until the DB is reachable, no silent fallback.
The item is not registered in your inventory, or the item field on the turret type does not match the inventory item name. Verify both sides. The item name on the type must be the exact key used by your inventory definition.
Placement
Your Bazq stream resource is not loaded, or starts after ml_turret. Move it above in server.cfg.
Use Config.NoPlaceZones. The ghost turns red inside these zones and cannot be confirmed. Three shape types supported: sphere, box, poly.
1Config.NoPlaceZones = {
2 { type = 'sphere', coords = vec3(298.6, -584.8, 43.3), radius = 80.0 },
3}Yes, via Config.PlacementProgress.anim. Any valid animation dict + clip works. The config comment lists four useful presets (hammering, rummaging, inspecting, repairing).
Ownership and Invites
It depends on permissions.canBeUsedByAll on the turret type. With true, anyone in range can use the turret. With false, the option appears only to the owner and group members.
Ownership uses the citizenid on QBCore and Qbox, and the license on ESX and standalone. Set Config.Ownership.playerNameFormat = 'rp_full' to show character names.
30 seconds by default. Configurable via Config.Ownership.inviteTimeoutSeconds.
No. Only the owner can invite or revoke members. Group members can open the panel, reload, repair and refuel but cannot transfer ownership or dismantle.
Combat and Damage
The weapon must be in the turret's weaponDamage table. It is a strict whitelist: unknown weapons are blocked as potential forge attempts. Add the weapon hash with an absolute HP value:
1weaponDamage = {
2 [`WEAPON_YOUR_WEAPON`] = 25,
3}Set infiniteHealth = true on the turret type (applies to every instance) or on a specific Config.FixedTurrets entry (per-instance). The damage pipeline short-circuits server-side.
Increase rotation.aimDeadZone, in metres. Inside this horizontal distance the turret holds its yaw. The default is 1.2m for bazq_heavy and 0.8m for cctv_sentry.
Increase targeting.switchCooldown, in milliseconds, on the type, or Config.AI.defaultSwitchCooldown for all of them. The default is 800ms.
Destruction and Repair
Open the panel via target, then Repair tab → select a repair item. Each repair item has an addHealth value configured in the turret type:
1repairItems = {
2 ['repair_kit'] = { addHealth = 300.0 },
3 ['welding_torch'] = { addHealth = 150.0 },
4}Target the rubble prop, then Repair Rubble → consumes one Config.Destruction.destructionRepairItem (default turret_rebuild_kit) and brings the turret back at 50% HP.
Yes, two options.
Per type, set canBeRepairedAfterDestruction = false: rubble still spawns but the Repair option is hidden (dismantle-only for salvage).
Per type, set permanentDestruction = true: destruction removes the turret's database row and frees its player quota. No rubble or repair option remains.
Set stayDestroyed = true on the instance in Config.FixedTurrets. When destroyed, the DB row keeps is_destroyed = 1 across restarts. To bring it back, run /turret_revive <fixed_config_id> as an admin, then restart the resource.
Change destroyedProp on the type. Valid GTA props include prop_rub_scrap_02, prop_rub_scrap_04, prop_rub_generator, prop_rub_boxpile_05, prop_dumpster_02a. Set nil to skip the rubble entirely (explosion only).
AI Behaviour
Set Config.AI.enabled = false. Every turret becomes manual-only.
Set targeting.targetPlayers = false, targetHumans = false, targetZombies = true on the turret type. For Config.HRS, either patch hrs_zombies to set the hrsIsZombie state bag, or add your zombie models to the zombieModels whitelist.
The owner and group members by default. For fixed turrets, configure ai.toggleableBy with a policy table:
1ai = {
2 enabled = true,
3 toggleableBy = { jobs = { 'police' }, aces = { 'command.turret' } },
4}Networking and Performance
One networked entity (the base) and a batch DB save every 60 seconds if the turret's state has changed. Fire events, muzzle flashes and damage reports are scope-limited to clients within 150m. AI logic runs entirely on clients.
Updates
- Download latest from CFX Portal
- Backup your
shared/config.lua,server/config_server.lua,locales/*.luaand any edits inopen/*.lua - Replace all other files
- Restart the resource
The resource creates a missing table with CREATE TABLE IF NOT EXISTS. This does not add columns to an existing table. Follow any database migration instructions included with an update.