updateGangInfo

This export updates the gang info from the gangs id

Usage

local newGangInfo = exports.gfg_gangs:updateGangInfo(id, name, label, reputation)
  • id: int (The gang id whose info you wish to update)

  • name: string (The new name of the gang)

  • label: string (The new label of the gang)

  • reputation: int (The new reputation of the gang)

Returns: table (This is the updated gang info)

  • id: int (The id of the gang)

  • name: string (The name of the gang)

  • label: string (The label of the gang)

  • reputation: int (The reputation of the gang)

Example

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

-- This gets the gang info from the current players gang
local playerGangInfo = exports.gfg_gangs:getGangInfoFromName(playerGang.name)

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

--[[
    playerGangInfo = {
        id = 1,
        name = "gfg",
        label = "GFG",
        reputation = 100
    }
]]

-- This updates the gang info using the id we jsut retrieved

local newPlayerGangInfo = exports.gfg_gangs:updateGangInfo(playerGangInfo.id, "newgfg", "New GFG", 1000)

print("New Player Gang Info:")
print(json.encode(newPlayerGangInfo, {indent = true}))

--[[
    newPlayerGangInfo = {
        id = 1,
        name = "newgfg",
        label = "New GFG",
        reputation = 1000
    }
]]

Last updated