Commands#
Crime Creator keeps commands to a minimum — almost everything happens in its windows. These are the ones it registers:
Command | Who | Description |
|---|---|---|
| Admins and | Opens the creator: organizations, season pass, vehicle store, territories, taxing and PvP battles. |
| Admins | Gives XP to an organization — for events, compensation or testing. |
| Organization members | The gang interaction menu. The key is |
| The | Removes the headbag from the nearest player within 3 m. Defined in |
With
Config.Debug = truethe resource also registers graffiti test commands (/testgraffiti,/removegraffiti,/listgraffitis). They are for development; keep debug off on a live server.
Client Exports#
For reading the player's gang from your own scripts, and for opening Crime Creator's tools from an item, a radial menu or a phone app.
GetPlayerGang
The local player's organization, or nil when they are not in one. GetPlayerGangName is an alias that returns the same table.
local gang = exports['qs-crime-creator']:GetPlayerGang()
if gang then
print(gang.id, gang.label, gang.isBoss)
if gang.rank then print(gang.rank.label) end -- the member's rank
if gang.permissions and gang.permissions.canAccessStash then
print('can open the stash')
end
endOpening the tablet and the tools
These are the same exports the ox_inventory item definitions call.
exports['qs-crime-creator']:tablet() -- open the Crime Tablet
exports['qs-crime-creator']:binoculars() -- open the binoculars
exports['qs-crime-creator']:graffiti() -- start spraying (uses organization_paint)
exports['qs-crime-creator']:graffitiCleaner() -- remove the nearest graffitiMoney laundering
Useful for a garage or a chop shop that should refuse the laundering van.
local active = exports['qs-crime-creator']:isMoneyLaunderingActive() -- boolean
local vehicle = exports['qs-crime-creator']:getMoneyLaunderingVehicle() -- entity handle or nil
if active and vehicle == GetVehiclePedIsIn(PlayerPedId(), false) then
return -- the laundering van: not yours to store
endinDecorate
Whether the player is decorating a headquarters right now — hide your HUD or block other menus while it is true.
local decorating = exports['qs-crime-creator']:inDecorate()Server Exports#
How another resource reads and changes gang membership, rewards organizations, controls headbags and feeds territory wars.
GetPlayerGang
A player's organization. When they belong to none, every field is nil and isBoss is false. GetPlayerGangName is an alias.
local gang = exports['qs-crime-creator']:GetPlayerGang(source)
if gang.id then
local rankLabel = gang.rank and gang.rank.label or 'no rank'
print(('%s is in %s (%s)'):format(GetPlayerName(source), gang.label, rankLabel))
end
-- gang = { id, label, isBoss, permissions, rank,
-- member = { identifier, name, joinedAt, rankId, isBoss, rank } }SetPlayerGang
Moves an online player into an organization, out of any they were in. isBoss and rankId are optional.
local ok, err = exports['qs-crime-creator']:SetPlayerGang(targetSource, 12, false, 3)
if not ok then
print('SetPlayerGang failed:', err)
-- invalid_source · invalid_org_id · player_not_online · organization_not_found
-- invalid_rank_id · rank_not_found · identifier_not_found · failed_to_update_gang
-- failed_to_remove_old_gang · failed_to_add_new_gang
endFirePlayerGang
Removes an online player from their organization.
local ok, err = exports['qs-crime-creator']:FirePlayerGang(source)
if not ok then
print('FirePlayerGang failed:', err)
-- invalid_source · player_not_online · identifier_not_found · not_in_gang · failed_to_remove_gang
endGetFilteredGangs
Every organization, sorted by name, with its owner and members — for a phone app, a scoreboard or an admin panel.
local gangs = exports['qs-crime-creator']:GetFilteredGangs()
for i = 1, #gangs do
local g = gangs[i]
print(g.id, g.name, g.color, g.memberCount, g.onlineCount)
-- g.owner = { identifier, name, isOnline } or nil
-- g.members = { { identifier, name, isBoss, rankId, rankLabel, isOnline, joinedAt }, ... }
endGetOrganizationRanks
local ranks, err = exports['qs-crime-creator']:GetOrganizationRanks(12)
-- ranks = { { id, label, permissions }, ... }
-- err = 'invalid_org_id' | 'organization_not_found'addOrganizationXP
Rewards an organization from another script — a heist, a race, an event. The level is recalculated with your XP formula. Returns false for zero or negative amounts.
local gang = exports['qs-crime-creator']:GetPlayerGang(source)
if gang.id then
exports['qs-crime-creator']:addOrganizationXP(gang.id, 250)
endHeadbag
Read and control the headbag from a police, kidnapping or hospital script. The setters return false when the player is already in that state.
local bagged = exports['qs-crime-creator']:hasHeadbag(playerId) -- boolean
exports['qs-crime-creator']:putHeadbagOn(playerId)
exports['qs-crime-creator']:takeHeadbagOff(playerId)TerritoryWarOnPlayerKilled
Credits a kill to a territory war. Call it from your death event — see Integrations. Returns true when the kill counted.
AddEventHandler('esx:onPlayerDeath', function(data)
local victim = source
local killer = data and data.killerServerId
if killer and killer ~= victim then
exports['qs-crime-creator']:TerritoryWarOnPlayerKilled(killer, victim)
end
end)State Bags and Events#
A player's organization id is replicated as a state bag, so any script can read it without calling an export:
-- client
local orgId = LocalPlayer.state.organization
-- server
local orgId = Player(source).state.organizationEvent | Side | Description |
|---|---|---|
| Client (net) | Shows a Crime Creator notification: |
| Client (net) | Opens the tablet for that player. |
| Client and server | Fired when a player enters or leaves a headquarters: |
| Client | A graffiti appeared or was cleaned. |
| Client | A territory war ended; carries the winning organization. |
| Server | A drug sale inside a territory: |
About the Errors#
The setters return short error codes, not sentences — not_in_gang, rank_not_found, player_not_online. Log the code in your own script and show your own message, so it reads correctly in your server's language.



