gta6/prompts
gangs
Vaultintermediategangs

Turf War Declaration & War State

ESX turf-war declaration that opens a timed war window against a rival's zone with a server-owned two-gang war-state machine.

NON-TESTÉ — the reference Lua is syntax-validated, not run in a live FiveM server. Adapt and test on your own dev server before shipping.
Est. Lua
~89 loc
Claude
Claude Opus 4.x / Sonnet 4.x
Validation
syntax-validated
Updated
2026-06-25

Description

A working ESX turf war declaration: a gang member walks to a rival's zone, plants a war marker, and opens a timed war window tracked by a server-owned two-gang state machine (attacker, defender, end time). When the timer expires the war auto-closes. This is the headline gang-warfare mechanic a server builds its whole faction loop around.

Prompt Template

You are writing a FiveM resource for esextended (stable, exports getSharedObject).

πŸ”’ Eyes-only β€” locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth β€” both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access β€” pay once
Most Popular Β· Best Value
Vault$199one-time
  • All 510 prompts β€” the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates β€” new niches as the market moves
Get the Vault β€” $199

$49 for 60 Β· $199 for all 510 + intelligence β€” one-time, no subscription.

Expected Output

The reference Lua lives at content/expected-outputs/gangs/14-turf-war-declaration.lua. It implements a proximity declare action with a plant animation, a server-side Wars table that validates…

πŸ”’ Eyes-only β€” locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth β€” both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access β€” pay once
Most Popular Β· Best Value
Vault$199one-time
  • All 510 prompts β€” the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates β€” new niches as the market moves
Get the Vault β€” $199

$49 for 60 Β· $199 for all 510 + intelligence β€” one-time, no subscription.

Known Failure Modes & Corrective Prompt

  • Client-side war clock β€” storing endAt on the client gives every player a different war window; keep the Wars table and the expiry thread on the server.
  • Anim before load β€” TaskPlayAnim no-ops if the dict is not loaded; always RequestAnimDict + while not HasAnimDictLoaded(dict) do Wait(0) end.
  • Self-war / double-war β€” without guards a gang declares on itself or stacks wars; reject attacker == defender and any zone already in Wars.

Corrective re-prompt: Keep the Wars table and a single expiry CreateThread on the server. In turfwar:declare resolve the defender from ZoneOwner, read the attacker from the caller's gang, and reject when there is no defender, attacker == defender, or Wars[zoneId] already exists. Broadcast every state change with TriggerClientEvent('turfwar:state', -1, ...).

Framework Integration

  • ESX: exports['es_extended']:getSharedObject(); attacker gang from xPlayer.getJob().name.
  • QBCore: exports['qb-core']:GetCoreObject(); attacker from Player.PlayerData.gang.name in the declare handler.
  • QBox: exports.qbx_core:GetPlayer(src); read player.PlayerData.gang.name; same Wars machine and expiry thread.

Profit Potential

$400–$6000/mo on Tebex (expected ~$1500). [INFERRED] priced inside the $50-389 FiveM script band against a corpus median seller of $11.85K/mo (signal-scraper tebex_snapshot n=100), scaled up for a hot headline-feature niche.

Trend Signal

πŸ”₯ hot β€” strategy: Matrix 'turf war/warfare' β€” the declaration + war-state machine is the headline gang feature that drives category sales.

Sales Angle

Lead the entire store listing with this β€” it is the demo-able war moment. Recommended Tebex price $189-249 as the cornerstone of a war suite.

Difficulty & Ship Time

intermediate Β· ships in 1 day.