Real Ink.
On a Real Wall. For Real.
rde_crew is a production-grade crew/gang and territory-control system for ox_core. Territory is claimed by physically standing at a wall and freehand-painting your tag with the mouse — the result renders as an actual flat 3D object stuck to that wall, visible to every nearby player, contested through declared wars.
Overview
Crews are created, ranked, and permissioned through ox_core characters — not a separate identity layer. Territory is real, in-game-editable polygon zones, claimed not by an admin spreadsheet but by freehand-painting a tag, then rotating and scaling it directly on the wall surface before confirming placement.
Why this over other crew/gang scripts
| Other Crew/Gang Scripts | rde_crew |
|---|---|
| Territory tag = a fixed font string stamped on the wall | Real freehand painting — your mouse, your lines, your tag |
| Zones hardcoded as lat/long boxes in a config file | In-game polygon zone editor — walk the perimeter, save |
| Minimap zone colors update on reconnect or restart | Live DUI pipe — zone turns crew color instantly, for everyone |
| Permissions = "admin" or "not admin" | 9 granular permission flags per grade, up to 8 grades |
Quick Start
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_target
ensure rde_crew
-- OrgBridge: rde_organizations must start BEFORE rde_crew
bzzz_decals — a free third-party prop pack with confirmed real alpha-blended materials — is required for graffiti rendering. It's streamed from rde_crew/stream/, no separate download needed.
Define each spray can color as a normal ox_inventory item, then add one line per color to Config.Territory.sprayCans. All tables auto-create on first start.
Graffiti — Real Freehand Painting
A two-screen NUI flow. Screen 1 — Draw: freehand canvas, pick from carried spray cans and one of 7 authentic cap types. Finished strokes bake once onto an offscreen buffer — cost stays flat no matter how detailed the piece. Screen 2 — Place: rotate and scale the finished piece directly on a simulated wall surface before confirming.
| Cap | Width | Edge |
|---|---|---|
| Skinny | 2px | Crisp — hairline precision |
| NY Cap | 8px | Crisp — the classic outline cap |
| Fat Cap | 20px | Feathered — fills |
| Ultrawide | 50px | Maximum spread — banana cap |
The finished canvas exports as a real PNG with genuine alpha transparency. CreateRuntimeTextureFromImage applies it directly to the bzzz_decals carrier prop — a real flat 3D object with real transparency, physically stuck to the wall. A full orthonormal basis (SetEntityMatrix) places it flush on any wall regardless of angle.
Territory & Zones
In-game polygon zone editor — walk the perimeter, place corners live, persist to DB, edit any time. Zone ownership is computed by last_spray or spray_count, and war-gated: an enemy crew can only overspray your owned zone while an active war exists between both crews. Ownership changes broadcast instantly via per-zone statebags, and the minimap DUI texture updates in the same frame — no rebuild, no delay.
Config.Territory = {
sprayMaxDistance = 3.0,
takeoverRule = 'last_spray', -- or 'spray_count'
requireWarToOverspray = true,
}
OrgBridge — rde_organizations Integration
rde_organizations becomes the HR layer (who's in a crew, what rank, what permissions), rde_crew stays the territory layer (which zone a crew owns, where their graffiti is, active wars). Neither resource needs to know the other exists — the bridge is invisible glue.
| Action in rde_organizations | Result in rde_crew |
|---|---|
| Create a gang / MC / criminal org | Crew auto-created and linked |
| Rank changed (promote/demote) | Crew grade updated instantly |
| Org disbanded | Crew dissolved, graffiti cascade-deleted |
Standalone mode: set Config.OrgBridge.enabled = false and rde_crew runs exactly as before — boss NPC, /crew menu, manual management. The bridge is purely additive.
Security
🩸 The Graffiti Saga: A War Story
Every config comment in this resource that starts with "CONFIRMED IN TESTING" or "BUGFIX" is a scar from one overnight session. The plan was simple: player draws on a canvas, art gets projected onto the wall as a decal. A weekend feature, surely.
| Round | What happened |
|---|---|
| 1 — AddDecal | GTA's native bullet-hole system, repurposed. IsDecalAlive returned true. Nothing visible on the wall — a known, undocumented Rockstar issue. Abandoned. |
| 2 — AddReplaceTexture | A real prop (prop_ld_filmset) via manual asset hunting. Ran without error. Still showed the original art, never the custom texture. |
| 3 — Root cause found | GitHub issue citizenfx/fivem#1684: AddReplaceTexture doesn't support DUI-sourced textures on any branch except Release. This server runs latest. |
| 4–5 — Rebuild + retry | Rebuilt the pipeline around a base64 PNG instead of a DUI browser. Retried AddDecal with a non-DUI source. Same result, twice. |
| 6–11 | Named render targets, cinema screen props, a database table found wiping itself on every boot, race conditions, parallelogram distortion, and a prop whose embedded texture name turned out to be prop_fruit_box_01. |
| 12 — bzzz_decals | A free third-party addon prop pack with a confirmed real alpha-blended material, verified in OpenIV before integrating a single file. It worked. Real ink, on a real wall. |
Common Pitfalls
Zone color race condition
AddStateBagChangeHandler fires with new ownership data as the value parameter — but GlobalState[key] read inside the handler returns the old/nil value.
Fix (v2.0.1): use value.ownerCrewId directly, passed as an override into the texture builder. A ZoneBuildPending guard prevents concurrent threads destroying each other's textures.
Hot-loop performance
The spray aim loop ran 6 raycasts at Wait(0) — 60+ fps.
Fix (v2.0.1): throttled to Wait(16), plus cache.ped replacing PlayerPedId() in all hot paths. ~10× lower CPU at idle.
FAQ
Is rde_organizations required?
No — fully optional. Without it, rde_crew runs standalone with its own boss NPC and /crew menu.
How many graffiti pieces can render at once nearby?
The render pool has 10 slots by default — extend GRAFFITI_PROP_POOL in client/modules/spray.lua for denser territory clusters.
Changelog
OrgBridge integration, 7 authentic cap types, full orthonormal wall alignment, ~10× lower idle CPU.
Two-screen NUI flow (draw → place), O(1) canvas drawing, rotation column added via auto-migration.