Installation guide

Cipher

A modular criminal tablet with gang management, territory, reputation, tasks, crafting, dealers and boosting.

01

Requirements

Required

  • Framework: QBox (qbx_core) or QBCore (qb-core) — the bridge auto-detects.
  • ox_lib
  • oxmysql
  • ox_inventory — the vault, armory and the device item all depend on it.

Optional

  • ox_target — proper target interactions on the vault, benches and dealer ped. Without it everything falls back to an [E] proximity prompt.

Current release is v0.1.

02

Installation

  1. Drop the cipher folder into your resources directory.
  2. Import sql/cipher.sql into your database.
  3. Add an item named cipher_tablet to your ox_inventory items, or point Config.DeviceItem at a name you already have.
  4. Add the start line to server.cfg — it must come after ox_lib, oxmysql, your framework and ox_inventory.
  5. Grant yourself the admin ACE (next section), then work through config.lua.
ensure cipher

Give yourself a tablet from your inventory admin tools, or run /gangops.

03

Admin access

Staff manage everything in-game through the admin tablet rather than by editing config or the database by hand. Access is an ACE permission:

add_ace group.admin cipher.admin allow
add_principal identifier.fivem:1234 group.admin

Then run /admintablet. Six tabs:

  • Dashboard — gang count, zones assigned, total gang bank, boosting totals, chat counts, dealer cooldown state.
  • Gangs — create, rename, set boss, disband, kick, promote, adjust personal rep or gang notoriety, force-set the bank balance.
  • Zones — create a zone at your current position, move or rename it, assign or clear its holder.
  • Boosting — search any player, edit their level, XP, totals and perk points, or reset them.
  • Blackmarket — read recent world chat with delete buttons, and resolve a handle to a citizenid when moderation needs it.
  • Dealer — view rotating stock, force a reroll, clear the global cooldown.

Every action re-checks the ACE permission server-side rather than just hiding buttons, and writes to the Discord admin webhook. Config.Gangs only seeds gangs on first boot — after that the database is the source of truth.

04

Gangs and progression

Membership

Gangs are admin-defined. Create, disband and boss changes happen on the admin tablet; invite, accept, kick, promote and demote happen in-game. Ranks and permissions are config-driven with per-gang ranks stored in the database.

Rep and notoriety

Each member has personal rep, which feeds a gang-wide notoriety total with four broad tiers. There is no idle decay — rep only drops through the friendly-fire penalty (Config.Notoriety.friendlyFirePenalty, killing your own gang member) or an admin adjustment.

Levels and perks

Config.GangLevels layers a more granular level and title (Crew through Untouchable) on the same notoriety value. Crossing a level threshold awards perk points, spent in Config.GangPerks across three branches — Vault (slots and weight), Recruitment (max members) and Workshop (craft time, bonus output, early recipe unlocks). Tier N in a branch requires tier N-1. Boss-only, via manage_perks.

Territory

Zones are assigned entirely through the admin tablet. There is no in-world capture and no passive income — holding a zone is prestige only. The blip radius grows with the holder's tier (Config.ZoneRadiusGrowthPerTier), which is purely visual.

Vault, benches and crafting

The vault is a physical placed container backed by a per-gang ox_inventory stash, not a remote button. Place it and the benches from the tablet's Unlocks tab once your tier allows: hit Place, scroll to set distance, Q/E to rotate, Enter to confirm.

There is one bench. Recipes in Config.Recipes each carry a tier requirement, so higher tiers unlock more recipes at that same bench. Inputs and outputs are validated server-side against the player's real inventory.

Treasury

No forced dues. Any member can deposit; withdrawing is gated behind manage_bank so one person cannot drain it. Transactions go to a dedicated ledger (cipher_gang_bank_log) separate from the activity log.

05

The apps

The device is a shell that hosts apps. Register new ones in shared/apps.lua — the shell needs no changes.

Gang Ops

Overview, roster, territory map, tasks, unlocks, treasury, perks and activity log. Tasks are solo jobs, fully server-validated:

  • type = 'delivery' — target the pickup, then a delivery ped at the dropoff. Each step re-checks the player's real position server-side.
  • type = 'kill' — the server picks a spawn point, the client spawns an armed hostile and reports the kill. The report is only trusted after minKillSeconds.

Dealer and drug selling

The dealer is on-demand from the Tasks tab. One call at a time server-wide on Config.Dealer.cooldownHours — a global cooldown, not per player. Stock rotates on rotateMinutes with randomized pricing. Config.Dealer.pool ships empty, so add entries or the dealer has nothing to sell.

Drug selling works anywhere, not just in territory: target any nearby NPC with ox_target, or /selldrug to grab the nearest one. The server validates the real item count and a per-player cooldown before paying.

Blackmarket

Anonymous world chat plus handle-addressed DMs. Requires gang membership — the app does not appear in the rail otherwise, and that is enforced server-side too. Every character gets a persistent, renameable handle (e.g. ShadowFox-A1B2) that is never tied to their gang. Only the server can resolve a handle to a citizenid.

Boosting

Car theft, open to everyone regardless of gang membership, and fully standalone — no gang rep, no gang tie-in. Tracks its own level and XP in cipher_boost_stats.

Config.Boosting.levels is cumulative: at level N you can be assigned any vehicle from levels 1 to N. There is no custom lockpick minigame — the vehicle spawns locked with no keys and qbx_core's own break-in system handles the theft. Bring it to the drop-off, get out, and sell to the buyer ped. The sale is validated against the vehicle's position, not the player's.

Co-op invites a nearby player to a harder job: more guards, shorter clock, dispatch always fires instantly. Cash gets Config.Boosting.coop.cashBonusPct before splitting evenly; XP is not split, everyone gets the full amount.

Config.Boosting.dispatch is disabled by default. The event and payload shape in the config is an example for cd_dispatch — you have to adjust it to whatever dispatch resource you actually run.

06

Discord logging

All optional. Set any of these to a webhook URL to get live embeds; leave one blank to disable that category.

Config.Discord.adminWebhook     -- every /admintablet action (the audit trail)
Config.Discord.gangWebhook      -- founded, disbanded, boss changed
Config.Discord.economyWebhook   -- deposits, withdrawals, dealer purchases

Get a URL from Discord: channel settings → Integrations → Webhooks → New Webhook → Copy URL.

07

Exports

Other resources can feed the notoriety system directly:

exports.cipher:AddNotoriety(gangId, amount, reason)
08

Before going live

  • Config.Dealer.pool is empty by default — add entries or the dealer sells nothing.
  • Drug selling defaults to a few common item names. Rename them to match your ox_inventory items.lua.
  • Config.Boosting.dispatch needs rewriting for your dispatch resource before you enable it.
  • The money API assumes both frameworks expose Player.Functions.AddMoney and RemoveMoney. Verify against your build and adjust the bridge if needed.
  • Verify any model name before putting it in config — use /testmodel <name> [ped]. Guessed model names fail silently or with confusing errors.

Known trust boundaries

Stated plainly so you can decide if they matter for your server: placement validates the final spot is within 6m of the placing player server-side, but otherwise trusts the client-reported ghost position. That is fine for a Boss-only permissioned action and is not meant to resist a malicious client. The kill task type trusts the client's kill report after minKillSeconds.

09

Troubleshooting

The tablet does nothing when used

The item name in your inventory does not match Config.DeviceItem (default cipher_tablet).

/admintablet says no permission

The cipher.admin ACE is not granted to a principal you belong to. Both the add_ace and add_principal lines are needed.

The Blackmarket app is missing from the rail

Working as intended — it requires gang membership, enforced server-side.

Calling the dealer produces nothing

Config.Dealer.pool is empty. Also note the cooldown is server-wide, so another player may have used the call.

Vault or bench will not open

Without ox_target you need to stand close enough for the [E] prompt. Check the placement actually saved — placement is Boss-gated via place_objects.

A model spawns invisible or errors

Run /testmodel <name> before trusting any model name in config.

10

Updating

  1. Back up the database. Gangs, rep, territory, vaults, treasury and boosting stats all live there.
  2. Keep a copy of your edited config.lua — it holds your ranks, zones, recipes and perks.
  3. Check recent commits for SQL changes before replacing files.
  4. Replace the resource folder, merge your config back, restart.
11

Support

Include your framework (QBox or QBCore), whether ox_target is running, the full console error and the steps that caused it.