createGangRank

This creates a new rank for the gang

Usage

local newGangRank = exports.gfg_gangs:createGangRank(gang_name, rank, name, label, canRecruit, canManage, isBoss)
  • gang_name: string (The gang name that the rank should be 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)

Returns: table (The new rank data)

  • 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 creates a new rank to the players gang
local newGangRank = exports.gfg_gangs:createGangRank(playerGang.name, 3, "newrank", "New Rank", 1, 1, 0)

print("New Gang Rank Data:")
print(json.encode(newGangRank, {indent = true}))

--[[
    newGangRank = {
        id = 4,
        gang_name: "gfg",
        rank = 3,
        name = "newrank",
        label = "New Rank",
        canRecruit = 1,
        canManage = 1,
        isBoss = 0
    }
]]

Last updated