Kartik Scripts

Migrating from op-crime

Gangs V2 can import a server running op-crime: every op-crime organisation becomes a Gangs V2 gang with its members, ranks, money, level and stash. It reads straight from your database, so there is nothing to export.


📦 What Gets Migrated

op-crimeGangs V2
Organisations (opcrime_orgs)Gangs with the same name, colour and logo (graffiti image)
Level and experienceLevel and XP, kept within that level
Balance and dirty moneyClean and dirty treasury
Upgrades (stash, member, rank, vehicle and outfit slots, garage, black medic, laundering, market, gang wars)The matching upgrades. Never lower than the Gangs V2 starting values
Interior: entrance and garage points, MLO points or shellHideout entrance, garage, desk, stash and wardrobe
Captured zones, missions done, wars won and totalGang stats
Monthly finance chartTreasury chart
Battle pass: premium and claimed levelsSeason pass progress
Ranks (opcrime_ranks)Ranks in the same order. Rank 1 becomes the boss with every permission
Members (opcrime_players)Members on the rank with the same name. Owners become boss
Gang stash (organisation_<id> in ox_inventory)The gang's stash
Turf zones and influence (opcrime_turfzones)Turfs with each gang's influence
Racketeering pointsRackets
Black medic locationsBlack Medic locations
Spy cameras and car GPS trackersSurveillance cameras and trackers
Gang dealership vehiclesDealership catalogue, with stock, sold count, allowed gangs and hidden state

Rank Permissions

op-crime permissions are turned into Gangs V2 permissions:

op-crimeGangs V2
Boss menuManagement, Treasury, Recruit, Discipline, Rank Editor, Branding, Season Pass
GarageGarage
StorageStash
Black medicBlack Medic
Money laundryLaundering
Gang warsGang Wars, Rivalries, Turf Control
FurnitureFurniture

Every rank also gets Wardrobe, Contracts, Market and Racketeering. A gang without any ranks gets the default Boss, Lieutenant and Soldier ranks.

What Does Not Carry Over

  • Outfits. op-crime saves clothing in a different format. They stay in opcrime_clothing; re-save them in the hideout wardrobe.
  • Stash items on other inventories. Only ox_inventory stashes are copied. On other inventories the report warns and the stash starts empty.
  • Members whose rank no longer exists are placed on the gang's lowest rank. The report lists each one.

🚀 Running the Migration

Back up your database first, and stop op-crime. The import refuses to run while it is started, so balances cannot change halfway through.

  1. Start kartik-gangs once so its tables are created.
  2. In the server console, run kg_import_opcrime. This is a preview: it prints every gang, turf and location it would import, and writes nothing.
  3. Fix every error in the report (see Problems That Block the Import). Warnings do not block it.
  4. Run kg_import_opcrime confirm.
  5. restart kartik-gangs to load the imported gangs.
CommandDescription
kg_import_opcrimePreview. Prints the full report, changes nothing.
kg_import_opcrime confirmRuns the import.

Both run from the server console only.


🛟 Safety

  • All or nothing: the whole import is written in one transaction. If anything fails, it is rolled back and nothing is written.
  • Runs once: after a successful import, running it again is refused, so gangs are never imported twice.
  • op-crime data is never changed: its tables and stash rows are only read. Drop them yourself once you are happy.
  • Existing gangs are kept: imported gangs get new IDs after your existing ones, so nothing is overwritten.

🧭 Problems That Block the Import

The preview lists every one of these. Fix them, then run the preview again.

ErrorFix
A Gangs V2 gang with that name already existsRename or delete one of them
Two op-crime gangs have the same nameRename one in op-crime
A character is in two op-crime gangs, or already in a Gangs V2 gangRemove them from one gang
A stash has more stacks than StashSlotsRaise StashSlots in shared/hideout.lua (see Hideout)
ox_inventory already has a stash called kg_stash_<id>Remove the leftover stash row
A gang name longer than 64 charactersShorten it in op-crime
opcrime_orgs not foundImport the op-crime tables into this database first

➡️ Next: Language

On this page