Exports
Documented exports for Wasabi Gang Creator (wasabi_gangs).
Server exports are trusted: they do not check permissions of a calling player, so only call them from your own server code. Mutating exports use the same validation, database writes and client updates as the in-game menus.
Client exports
OpenActionMenu
Open the radial action menu (same as the keybind).
exports['wasabi_gangs']:OpenActionMenu()
OpenBossMenu
Open the boss menu for a member with Access Boss Menu.
exports['wasabi_gangs']:OpenBossMenu()
OpenTablet
Open the gang tablet.
exports['wasabi_gangs']:OpenTablet()
ViewCameras
Open the security camera viewer (Security Cameras upgrade and Management category).
exports['wasabi_gangs']:ViewCameras()
ToggleDrugSelling
Start or stop corner drug selling.
exports['wasabi_gangs']:ToggleDrugSelling()
StartGraffiti
Open the graffiti tag prompt (spray item and membership checks apply).
exports['wasabi_gangs']:StartGraffiti()
CleanGraffiti
Remove the nearest graffiti (cleaner item check applies).
exports['wasabi_gangs']:CleanGraffiti()
CloseAllMenus
Close any open gang screen (creator, boss menu, tablet, radial, prompts) and open gang context menus.
exports['wasabi_gangs']:CloseAllMenus()
Player state
GetPlayerOrg
Cached organization snapshot of the local player. No server call.
local org = exports['wasabi_gangs']:GetPlayerOrg()
Returns: table|nil with id, label, color, rank, isOwner, permissions, base, upgrades; nil when not a member.
IsPlayerCuffed
Whether the local player is cuffed by a gang action.
local cuffed = exports['wasabi_gangs']:IsPlayerCuffed()
Returns: boolean
IsHeadbagged
Whether the local player wears a headbag.
local bagged = exports['wasabi_gangs']:IsHeadbagged()
Returns: boolean
IsDownedLocal
Whether the local player is downed (ambulance last stand or dead).
local downed = exports['wasabi_gangs']:IsDownedLocal()
Returns: boolean
Bases and territories
IsInsideBase
Whether the local player is inside an organization base.
local inside, orgId = exports['wasabi_gangs']:IsInsideBase()
Returns: boolean, number|nil organization id.
GetCurrentBase
The base the local player is inside.
local base = exports['wasabi_gangs']:GetCurrentBase()
Returns: table|nil
GetCurrentTerritory
The territory the local player stands in (the smallest one when territories overlap).
local territory = exports['wasabi_gangs']:GetCurrentTerritory()
Returns: table|nil with id, label, ownerId, ownerLabel, color and war.
IsInTerritory
Whether the local player is inside a territory.
local inTurf = exports['wasabi_gangs']:IsInTerritory(territoryId)
| Parameter | Type | Required | Description |
|---|---|---|---|
territoryId | number | No | Territory id. Omit to check any territory. |
Returns: boolean
Server exports
Organizations
GetOrganization
Public data of an organization.
local org = exports['wasabi_gangs']:GetOrganization(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: table|nil with id, slug, label, color, level, xp, interiorType.
GetPlayerOrganization
The player's organization with their rank.
local org = exports['wasabi_gangs']:GetPlayerOrganization(source)
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server id. |
Returns: table|nil: organization data plus rank (label) and isOwner.
HasOrgPermission
Whether the player has a rank permission flag in their organization.
local allowed = exports['wasabi_gangs']:HasOrgPermission(source, 'manage_finance')
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server id. |
flag | string | Yes | Permission flag, see Quick References. |
Returns: boolean
CreateOrganization
Create an organization.
local orgId = exports['wasabi_gangs']:CreateOrganization({ label = 'Ballas', color = '#8e44ad', interiorType = 'mlo', owner = identifier })
| Parameter | Type | Required | Description |
|---|---|---|---|
data.label | string | Yes | 2-40 characters. |
data.color | string | No | Hex colour, #rrggbb. |
data.interiorType | 'mlo'|'shell'|'ipl' | No | Defaults to mlo. |
data.owner | string | No | Owner identifier. |
data.ownerName | string | No | Owner display name. |
Returns: number|nil organization id.
GetOrgMembers
All members of an organization.
local members = exports['wasabi_gangs']:GetOrgMembers(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: table[]|nil, each with identifier, name, rankId, rank, grade, isOwner, online and source (when online).
IsPlayerInOrg
Whether the player is a member of an organization.
local member = exports['wasabi_gangs']:IsPlayerInOrg(source, orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server id. |
orgId | number | No | Organization id. Omit to check any organization. |
Returns: boolean
GetPlayerRank
The player's rank in their organization.
local rank = exports['wasabi_gangs']:GetPlayerRank(source)
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server id. |
Returns: table|nil with id, label, grade and isOwner.
Members
AddMember
Add a player to an organization. The player is notified and the organization menus refresh, like the boss menu.
local ok, err = exports['wasabi_gangs']:AddMember(orgId, source, 'Member')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
identifierOrSrc | string|number | Yes | Framework identifier, or an online player server id. |
rank | number|string | No | Rank id, rank label or grade. Defaults to the lowest rank. |
Returns: boolean, string|nil error (not_found, invalid, already_member, rank_not_found, server_error).
RemoveMember
Remove a member. The owner cannot be removed (same rule as the boss menu).
local ok, err = exports['wasabi_gangs']:RemoveMember(orgId, identifier)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
identifier | string | Yes | Member identifier. |
Returns: boolean, string|nil error (not_found, not_editable, server_error).
SetMemberRank
Change a member's rank. The owner's rank cannot be changed.
local ok, err = exports['wasabi_gangs']:SetMemberRank(orgId, identifier, 'Shot Caller')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
identifier | string | Yes | Member identifier. |
rank | number|string | Yes | Rank id, rank label or grade. |
Returns: boolean, string|nil error (not_found, not_editable, rank_not_found, server_error).
Money and progression
GetOrgBalance
An organization's balance.
local clean = exports['wasabi_gangs']:GetOrgBalance(orgId, 'clean')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
account | 'clean'|'dirty' | No | Defaults to clean. |
Returns: number|nil
AddOrgMoney
Pay money into an organization (recorded in the ledger).
exports['wasabi_gangs']:AddOrgMoney(orgId, 5000, 'dirty', 'Heist payout')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
amount | number | Yes | Positive whole amount. |
account | 'clean'|'dirty' | No | Defaults to clean. |
description | string | No | Ledger text. |
Returns: boolean
RemoveOrgMoney
Charge clean organization money (recorded in the ledger).
local ok = exports['wasabi_gangs']:RemoveOrgMoney(orgId, 2500, 'Supplies')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
amount | number | Yes | Positive whole amount. |
description | string | No | Ledger text. |
Returns: boolean: false when the balance is too low.
AddOrgXp
Give organization XP.
exports['wasabi_gangs']:AddOrgXp(orgId, 250, 'event_reward')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
amount | number | Yes | XP amount. |
reason | string | No | Logged reason. |
Returns: boolean
GetOrgLevel
Organization level and XP progress.
local stats = exports['wasabi_gangs']:GetOrgLevel(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: table|nil with level, xp, into, need, toNext, missions, maxLevel.
AddMissionProgress
Add progress to the organization's active daily missions of a type.
exports['wasabi_gangs']:AddMissionProgress(orgId, 'drug_sale', 1)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
kind | string | Yes | Mission type, e.g. graffiti, drug_sale, launder. |
amount | number | No | Defaults to 1. |
Territories and wars
GetTerritories
All territories.
local list = exports['wasabi_gangs']:GetTerritories()
Returns: table[]
GetTerritoryAt
The territory containing a position.
local territory = exports['wasabi_gangs']:GetTerritoryAt(coords)
| Parameter | Type | Required | Description |
|---|---|---|---|
coords | vector3 | Yes | World position. |
Returns: table|nil with id, label, ownerId, ownerLabel, color, corners and war.
IsInTerritory
Whether a position is inside a territory.
local inside = exports['wasabi_gangs']:IsInTerritory(coords, territoryId)
| Parameter | Type | Required | Description |
|---|---|---|---|
coords | vector3 | Yes | World position. |
territoryId | number | Yes | Territory id. |
Returns: boolean
GetTerritoryOwner
The organization owning a territory.
local orgId = exports['wasabi_gangs']:GetTerritoryOwner(territoryId)
| Parameter | Type | Required | Description |
|---|---|---|---|
territoryId | number | Yes | Territory id. |
Returns: number|nil organization id (nil when unowned).
SetTerritoryOwner
Set or clear the owner of a territory. Refused while the territory is at war.
local ok, err = exports['wasabi_gangs']:SetTerritoryOwner(territoryId, orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
territoryId | number | Yes | Territory id. |
orgId | number|nil | No | New owner. nil clears the owner. |
Returns: boolean, string|nil error (not_found, territory_at_war, org_not_found, server_error).
GetActiveWars
All running wars.
local wars = exports['wasabi_gangs']:GetActiveWars()
Returns: table[] with id, territoryId, attackerId, defenderId, endsAt and scores.
IsOrgAtWar
Whether an organization takes part in a running war.
local atWar, warId = exports['wasabi_gangs']:IsOrgAtWar(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: boolean, number|nil war id.
StartWar
Start a war without the declaration fee or online-member rule. The territory cooldown and one-war-per-territory rules still apply.
local warId, err = exports['wasabi_gangs']:StartWar(attackerOrgId, defenderOrgId, territoryId, 1800)
| Parameter | Type | Required | Description |
|---|---|---|---|
attackerOrgId | number | Yes | Attacking organization. |
defenderOrgId | number|nil | Yes | Must be the territory owner, nil for an unowned territory. |
territoryId | number | Yes | Territory id. |
duration | number | No | Seconds (minimum 60). Defaults to wars.duration. |
Returns: number|false war id, string|nil error (org_not_found, not_found, defender_mismatch, territory_at_war, war_cooldown, ...).
EndWar
End a running war now.
local ok, err = exports['wasabi_gangs']:EndWar(warId, winnerOrgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
warId | number | Yes | War id. |
winnerOrgId | number | No | Attacker or defender. Omit to let the score decide. |
Returns: boolean, string|nil error (not_found, invalid_winner).
AddWarPoints
Award war points to an organization in a running war.
exports['wasabi_gangs']:AddWarPoints(orgId, GetEntityCoords(GetPlayerPed(source)), 10, 'robbery')
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
where | vector3|number | Yes | Position inside the war territory, or the territory id. |
points | number | Yes | Points (negative to remove). |
kind | string | No | Logged reason. |
Returns: boolean
Players, storage and world
IsPlayerRestrained
Restraint state from gang actions.
local cuffed, headbagged = exports['wasabi_gangs']:IsPlayerRestrained(source)
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server id. |
Returns: boolean, boolean
GetOrgStashId
Inventory id of the organization stash.
local stashId = exports['wasabi_gangs']:GetOrgStashId(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: string|nil, e.g. wg_stash_2.
GetOrgVaultId
Inventory id of the organization vault (Vault Lock upgrade).
local vaultId = exports['wasabi_gangs']:GetOrgVaultId(orgId)
| Parameter | Type | Required | Description |
|---|---|---|---|
orgId | number | Yes | Organization id. |
Returns: string|nil, e.g. wg_vault_2.
GetGraffiti
All placed graffiti.
local tags = exports['wasabi_gangs']:GetGraffiti()
Returns: table[] with id, orgId, text, font, scale, color, coords and normal.