Here you will find all the useful exports for this asset, please read each step and example carefully to better understand how it works, we do not recommend using these if you are not an experienced developer.
GetGangFromSource
Check a player's gang using their source as identification.
-- source: Player sourceexports['qs-gangs']:GetGangFromSource(source)
getGangs
Export to sync the player's gang id
exports['qs-gangs']:getGangs()
An example of using this system would be the following.
functionSyncGangSystem()local gangs = exports['qs-gangs']:getGangs()local data = {}for name inpairs(gangs) dotable.insert(data, name)endinitCustomGangs(data)end
setGang
Export to give or remove gang.
-- Set gang to player idexports['qs-gangs']:setGang(id, gangName)
An example of using this system would be the following.
-- Set Gang examplefunctionAddGangSystemMember(id,gangID)local foundGangfor _, v inipairs(Gangs) doif v.id == gangID then foundGang = vbreakendendifnot foundGang thenreturnendlocal success, errorMessage = exports['qs-gangs']:setGang(id, foundGang.gangName)ifnot success thenprint('^1[^3ERROR^1] Failed to add gang to player: ' .. errorMessage)endend-- Remove Gang examplefunctionRemoveGangSystemMember(id,gangID)local success, errorMessage = exports['qs-gangs']:setGang(id, 'none')ifnot success thenprint('^1[^3ERROR^1] Failed to remove gang from player: ' .. errorMessage)endend