Exports

Server-side exports for Possible Gang MDT.

Important

The resource folder must be named possible-gang-mdt on the server. If it is renamed, these exports will not resolve.

Server exports from possible-gang-mdt. These are for permission checks from other resources (territory stashes, shops, wars, etc.).

The MDT itself talks to Territories / Gang Levels / Turfs through their exports — you do not need to re-wrap those here.

hasPermission

Lua
exports['possible-gang-mdt']:hasPermission(source, permissionName)

Parameters

NameTypeRequiredDescription
sourcenumber✅Player server id
permissionNamestring✅One of the permission keys below

Returns

TypeDescription
booleantrue if their current gang grade has that permission

Returns false if they are not in a gang.

Permissions

KeyUsed for
open_gang_stashOpening the gang stash
open_turf_shopOpening the turf / gang shop
open_territory_stashOpening a territory stash (when Territories has GangMDTv2 = true)
manage_membersInvite / kick / promote in the MDT
manage_territoriesTerritory actions in the MDT (e.g. peaceful toggle)
manage_warsDeclaring / managing wars

Boss grade always has every permission, even if the grade row says otherwise.

Example

Lua
if exports['possible-gang-mdt']:hasPermission(source, 'open_territory_stash') then    -- open stashend

getPlayerPermissions

Full permission table for the player's current grade.

Lua
exports['possible-gang-mdt']:getPlayerPermissions(source)

Parameters

NameTypeRequiredDescription
sourcenumber✅Player server id

Returns

TypeDescription
table|nilPermission map for their grade, or nil if not in a gang
Lua
{    open_gang_stash = true,    open_turf_shop = false,    open_territory_stash = true,    manage_members = false,    manage_territories = false,    manage_wars = false,}

Example

Lua
local perms = exports['possible-gang-mdt']:getPlayerPermissions(source)if perms and perms.manage_wars then    -- show war UIend

checkGradePermission

Same check as hasPermission, but you pass the gang and grade yourself (no online player required).

Lua
exports['possible-gang-mdt']:checkGradePermission(gangName, gradeLevel, permissionName)

Parameters

NameTypeRequiredDescription
gangNamestring✅Gang name (e.g. "ballas")
gradeLevelnumber✅Grade level to check (0 if omitted)
permissionNamestring✅Permission key

Returns

TypeDescription
booleanWhether that grade has the permission

Example

Lua
local canManage = exports['possible-gang-mdt']:checkGradePermission('ballas', 2, 'manage_members')

Territory map admin (via Territories)

Drawing / editing / deleting zones on the MDT admin map uses Possible Territories exports (CreateTerritory, UpdateTerritory, DeleteTerritory, etc.). Those live on possible-territories, not on the MDT.

On Territories you need:

Lua
TerritoryLocations = {    Mode = 'database',    AllowMdtManagement = true,    SeedFromConfigOnStart = true, -- first boot only — turn off after the DB is seeded},GangMDTv2 = true, -- if you want stash access to use MDT permissions

Use seed once to pull config.Zones into the database. After that, set SeedFromConfigOnStart = false so deletes / edits made in the MDT are not brought back from config on a Territories restart.

See the Territories Exports and Configuration pages for the full detail.

JDB-NET Logo
Partner Service

Self-hosted unlimited logs with managed Grafana

JDB-NET provides a self-hosted solution with unlimited logs, a fully managed Grafana instance, and unlimited users. Perfect for FiveM servers that need comprehensive logging and monitoring.

Check out JDB-NET