getPlayerGangInfoFromId

This export returns the players gang information from their server id

Usage

local playerGangInfo = exports.gfg_gangs:getPlayerGangInfoFromId(id)
  • id: int (The server id of the player whose gang you wish to retrieve)

Returns: table

  • name: string (The name of the gang the player is in)

  • rank: int (The rank of the player)

If you'd like to get the current players gang info you don't need to pass anything, the export will get the server id for you, but if you wish to obtain another players gang info from this client, then you need to pass that players server id.

Example

local playerGangInfo = exports.gfg_gangs:getPlayerGangInfoFromId()

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

--[[
    playerGangInfo = {
        name = gfg,
        rank = 1
    }
]]

Last updated