getGangRankData

This returns all the ranks for the gang from the gangs name

Usage

local gangRanks = exports.gfg_gangs:getGangRankData(name)
  • name: string (The name of the gang)

Returns: table

For each Rank

  • id: int (The id of the rank)

  • gang_name: string (The name of the gang the rank is associated with)

  • rank: int (The rank of the rank, where it sits in the hierarchy)

  • name: string (The name of the rank)

  • label: string (The label of the rank)

  • canRecruit: int (Whether or not that rank has recruitment ability, 0 being no, 1 being yes)

  • canManage: int (Whether or not that rank has management ability, 0 being no, 1 being yes)

  • isBoss: int (Whether or not that rank has boss ability, 0 being no, 1 being yes)

Example

-- This gets the current player gang
local playerGang = exports.gfg_gangs:getPlayerGangInfoFromId()

-- This Retrieves all the rank data from the players gang
local playerGangRanks = exports.gfg_gangs:getGangRankData(playerGang.name)

print("Player Gang Ranks:")
print(json.encode(playerGangRanks, {indent = true}))

--[[
    playerGangRanks = {
        {
            id = 1,
            gang_name: "gfg",
            rank = 0,
            name = "recruit",
            label = "Recruit",
            canRecruit = 0,
            canManage = 0,
            isBoss = 0
        },
        {
            id = 2,
            gang_name: "gfg",
            rank = 1,
            name = "member",
            label = "Member",
            canRecruit = 1,
            canManage = 1,
            isBoss = 0
        },
        {
            id = 3,
            gang_name: "gfg",
            rank = 2,
            name = "boss",
            label = "Boss",
            canRecruit = 1,
            canManage = 1,
            isBoss = 1
        },
]]

Last updated