Skip to main content

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)
ParameterTypeRequiredDescription
territoryIdnumberNoTerritory id. Omit to check any territory.

Returns: boolean

Server exports​

Organizations​

GetOrganization

Public data of an organization.

local org = exports['wasabi_gangs']:GetOrganization(orgId)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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)
ParameterTypeRequiredDescription
sourcenumberYesPlayer 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')
ParameterTypeRequiredDescription
sourcenumberYesPlayer server id.
flagstringYesPermission flag, see Quick References.

Returns: boolean

CreateOrganization

Create an organization.

local orgId = exports['wasabi_gangs']:CreateOrganization({ label = 'Ballas', color = '#8e44ad', interiorType = 'mlo', owner = identifier })
ParameterTypeRequiredDescription
data.labelstringYes2-40 characters.
data.colorstringNoHex colour, #rrggbb.
data.interiorType'mlo'|'shell'|'ipl'NoDefaults to mlo.
data.ownerstringNoOwner identifier.
data.ownerNamestringNoOwner display name.

Returns: number|nil organization id.

GetOrgMembers

All members of an organization.

local members = exports['wasabi_gangs']:GetOrgMembers(orgId)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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)
ParameterTypeRequiredDescription
sourcenumberYesPlayer server id.
orgIdnumberNoOrganization id. Omit to check any organization.

Returns: boolean

GetPlayerRank

The player's rank in their organization.

local rank = exports['wasabi_gangs']:GetPlayerRank(source)
ParameterTypeRequiredDescription
sourcenumberYesPlayer 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')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
identifierOrSrcstring|numberYesFramework identifier, or an online player server id.
ranknumber|stringNoRank 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)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
identifierstringYesMember 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')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
identifierstringYesMember identifier.
ranknumber|stringYesRank 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')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
account'clean'|'dirty'NoDefaults to clean.

Returns: number|nil

AddOrgMoney

Pay money into an organization (recorded in the ledger).

exports['wasabi_gangs']:AddOrgMoney(orgId, 5000, 'dirty', 'Heist payout')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
amountnumberYesPositive whole amount.
account'clean'|'dirty'NoDefaults to clean.
descriptionstringNoLedger text.

Returns: boolean

RemoveOrgMoney

Charge clean organization money (recorded in the ledger).

local ok = exports['wasabi_gangs']:RemoveOrgMoney(orgId, 2500, 'Supplies')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
amountnumberYesPositive whole amount.
descriptionstringNoLedger text.

Returns: boolean: false when the balance is too low.

AddOrgXp

Give organization XP.

exports['wasabi_gangs']:AddOrgXp(orgId, 250, 'event_reward')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
amountnumberYesXP amount.
reasonstringNoLogged reason.

Returns: boolean

GetOrgLevel

Organization level and XP progress.

local stats = exports['wasabi_gangs']:GetOrgLevel(orgId)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
kindstringYesMission type, e.g. graffiti, drug_sale, launder.
amountnumberNoDefaults 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)
ParameterTypeRequiredDescription
coordsvector3YesWorld 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)
ParameterTypeRequiredDescription
coordsvector3YesWorld position.
territoryIdnumberYesTerritory id.

Returns: boolean

GetTerritoryOwner

The organization owning a territory.

local orgId = exports['wasabi_gangs']:GetTerritoryOwner(territoryId)
ParameterTypeRequiredDescription
territoryIdnumberYesTerritory 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)
ParameterTypeRequiredDescription
territoryIdnumberYesTerritory id.
orgIdnumber|nilNoNew 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)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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)
ParameterTypeRequiredDescription
attackerOrgIdnumberYesAttacking organization.
defenderOrgIdnumber|nilYesMust be the territory owner, nil for an unowned territory.
territoryIdnumberYesTerritory id.
durationnumberNoSeconds (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)
ParameterTypeRequiredDescription
warIdnumberYesWar id.
winnerOrgIdnumberNoAttacker 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')
ParameterTypeRequiredDescription
orgIdnumberYesOrganization id.
wherevector3|numberYesPosition inside the war territory, or the territory id.
pointsnumberYesPoints (negative to remove).
kindstringNoLogged reason.

Returns: boolean

Players, storage and world​

IsPlayerRestrained

Restraint state from gang actions.

local cuffed, headbagged = exports['wasabi_gangs']:IsPlayerRestrained(source)
ParameterTypeRequiredDescription
sourcenumberYesPlayer server id.

Returns: boolean, boolean

GetOrgStashId

Inventory id of the organization stash.

local stashId = exports['wasabi_gangs']:GetOrgStashId(orgId)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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)
ParameterTypeRequiredDescription
orgIdnumberYesOrganization 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.