Exports
Server-side exports for Possible Gang MDT.
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
exports['possible-gang-mdt']:hasPermission(source, permissionName)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
source | number | ✅ | Player server id |
permissionName | string | ✅ | One of the permission keys below |
Returns
| Type | Description |
|---|---|
boolean | true if their current gang grade has that permission |
Returns false if they are not in a gang.
Permissions
| Key | Used for |
|---|---|
open_gang_stash | Opening the gang stash |
open_turf_shop | Opening the turf / gang shop |
open_territory_stash | Opening a territory stash (when Territories has GangMDTv2 = true) |
manage_members | Invite / kick / promote in the MDT |
manage_territories | Territory actions in the MDT (e.g. peaceful toggle) |
manage_wars | Declaring / managing wars |
Boss grade always has every permission, even if the grade row says otherwise.
Example
if exports['possible-gang-mdt']:hasPermission(source, 'open_territory_stash') then -- open stashendif exports['possible-gang-mdt']:hasPermission(source, 'open_territory_stash') then -- open stashendif exports['possible-gang-mdt']:hasPermission(source, 'open_territory_stash') then -- open stashendgetPlayerPermissions
Full permission table for the player's current grade.
exports['possible-gang-mdt']:getPlayerPermissions(source)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
source | number | ✅ | Player server id |
Returns
| Type | Description |
|---|---|
table|nil | Permission map for their grade, or nil if not in a gang |
{ open_gang_stash = true, open_turf_shop = false, open_territory_stash = true, manage_members = false, manage_territories = false, manage_wars = false,}Example
local perms = exports['possible-gang-mdt']:getPlayerPermissions(source)if perms and perms.manage_wars then -- show war UIendlocal perms = exports['possible-gang-mdt']:getPlayerPermissions(source)if perms and perms.manage_wars then -- show war UIendlocal perms = exports['possible-gang-mdt']:getPlayerPermissions(source)if perms and perms.manage_wars then -- show war UIendcheckGradePermission
Same check as hasPermission, but you pass the gang and grade yourself (no online player required).
exports['possible-gang-mdt']:checkGradePermission(gangName, gradeLevel, permissionName)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
gangName | string | ✅ | Gang name (e.g. "ballas") |
gradeLevel | number | ✅ | Grade level to check (0 if omitted) |
permissionName | string | ✅ | Permission key |
Returns
| Type | Description |
|---|---|
boolean | Whether that grade has the permission |
Example
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:
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 permissionsUse 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.
