Gangs & Territories
Commands, Exports & Events
Commands, Exports & Events for Gangs & Territories.
Commands
| Command | Who | Description |
|---|---|---|
/gangs | Everyone | Open the gang tablet (or your invites) |
/gangadmin | Gang admins | Open the admin panel |
lggangs <action> ... | Server console | Run admin actions from the console, e.g. lggangs setgang 12 Ballas 3 |
Exports
Server:
lua
local gang = exports.lg_gangs:GetPlayerGang(source) -- gang name or 'none'
local data = exports.lg_gangs:GetPlayerGangData(source) -- { gang, color, rank, rankName, isBoss } or nil
local boss = exports.lg_gangs:IsGangBoss(source)
local info = exports.lg_gangs:GetGang('Ballas') -- { name, color, image, ranks, maxMembers, sprayModel }
local gangs = exports.lg_gangs:GetGangs()
local members = exports.lg_gangs:GetGangMembers('Ballas') -- { { identifier, rank, name, source }, ... }
local online = exports.lg_gangs:GetOnlineGangMembers('Ballas') -- server ids
exports.lg_gangs:SetPlayerGang(source, 'Ballas', 0)
exports.lg_gangs:RemovePlayerGang(source)
local count = exports.lg_gangs:GetGangSprayCount('Ballas')
local sprays = exports.lg_gangs:GetActiveSprays('Ballas') -- or nil for all
local admin = exports.lg_gangs:IsGangAdmin(source)
exports.lg_gangs:RunAdminAction('addslots', { gang = 'Ballas', amount = 2 })Client:
lua
exports.lg_gangs:OpenTablet()
local gang = exports.lg_gangs:GetPlayerGang()
local pending = exports.lg_gangs:HasPendingInvites()
exports.lg_gangs:OpenShop('legion_spray_shop')Events (server, listen with AddEventHandler)
| Event | Arguments |
|---|---|
lg_gangs:server:memberJoined | (source, gangName, rank) |
lg_gangs:server:memberLeft | (identifier, gangName, reason) reason 'leave' or 'kick' |
lg_gangs:server:rankChanged | (identifier, gangName, oldRank, newRank) |
lg_gangs:server:sprayPlaced | (source, gangName, sprayId, gangSprayCount) |
lg_gangs:server:sprayRemoved | (source, removerGang, targetGang, sprayId) |
lg_gangs:server:shopPurchase | (source, shopId, paid) |
Last updated