Agency Docs
QBESXStandalone

Agency-Gangs Exports & API

The complete gang system for FiveM in one script.

v1.0.0Paid5 Pages

01Server Exports

ExportDescription
GetPlayerGang(src)The gang of an online player: id, name, label, tag, color, grade, rank, isLeader, level and bank, or nil when the player is in no gang.
GetGangByIdentifier(identifier)The same for a character identifier, also when the player is offline.
GetGang(nameOrId)One gang by its name or id, or nil.
GetGangs()All gangs with their public data: label, tag, colour, emblem, level, members and territories.
IsInGang(src, name)True when the player is in a gang. With a name or id only when it is that gang.
HasGangPermission(src, permission)True when the rank of the player has this permission, for example 'bank_withdraw' or 'stash'.
GetGangMembers(nameOrId)All members of a gang with identifier, name, grade and whether they are online.
GetOnlineMembers(nameOrId)The server ids of the online members of a gang.
AddGangMoney(nameOrId, amount, reason)Pays money into the gang bank and writes it to the gang history. Returns true when it worked.
RemoveGangMoney(nameOrId, amount, reason)Takes money from the gang bank. Returns false when the gang does not have enough.
AddGangDirtyMoney(nameOrId, amount, reason)Adds dirty money to the vault of a gang.
AddGangXP(nameOrId, amount)Gives a gang XP, levels up on its own.
GetTerritoryOwner(idOrName)The gang that holds a territory, or nil when it is unclaimed.
GetTerritoryAt(coords)The territory at a position with its id, name, label and owner, or nil.
IsTurfWarActive()True while a turf war runs.
AreAllied(gangA, gangB)True when two gangs are allies.
AreAtWar(gangA, gangB)True while two gangs fight a gang war.
HasHouseAccess(houseId, identifier)For housing scripts: true when the character may enter the house because it is the house of their gang.

02Events

NameSideDescription
agency-gangs:client:membershipChangedClientFires with the new gang data of the player (or nil) whenever they join, leave, change rank or their gang changes.
agency-gangs:client:nuiClosedClientFires when the gang menu closes.

Still stuck after this page? Our support team takes it from here.