Exports
Server and client exports for Possible Turfs.
The resource folder on your server must be named exactly possible_turfs. Do not rename it. Gang MDT and other Possible Scripts look for that name.
GetTurfStatus
Server export. Status for one turf zone.
exports['possible_turfs']:GetTurfStatus(zoneName)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
zoneName | string | ✅ | Turf zone name from config (e.g. "Kortz Center") |
Returns
| Type | Description |
|---|---|
table|nil | Status table, or nil if the zone is unknown |
{ zoneName = "Kortz Center", coords = { x = 0.0, y = 0.0, z = 0.0 }, -- from config radius = 50.0, owner = "ballas", -- or nil status = "idle", -- "idle" | "contested" | "cooldown" | "exploded" isBombPlanted = false, plantingGang = nil, exploded = false, bombExpiresAt = nil, -- unix time, or nil bombRemainingSeconds = 0, isOnCooldown = false, cooldownExpiresAt = nil, cooldownRemainingSeconds = 0,}Example
local status = exports['possible_turfs']:GetTurfStatus('Kortz Center')if status and status.status == 'contested' then print(status.plantingGang, 'planted a bomb')endlocal status = exports['possible_turfs']:GetTurfStatus('Kortz Center')if status and status.status == 'contested' then print(status.plantingGang, 'planted a bomb')endlocal status = exports['possible_turfs']:GetTurfStatus('Kortz Center')if status and status.status == 'contested' then print(status.plantingGang, 'planted a bomb')endSame data is also available via ox_lib callback possible_turfs:server:getTurfStatus.
GetAllTurfStatuses
Server export. Same shape as above, for every active turf.
exports['possible_turfs']:GetAllTurfStatuses()Parameters
None.
Returns
| Type | Description |
|---|---|
table | Array of status tables |
local all = exports['possible_turfs']:GetAllTurfStatuses()for _, status in ipairs(all) do print(status.zoneName, status.owner, status.status)endlocal all = exports['possible_turfs']:GetAllTurfStatuses()for _, status in ipairs(all) do print(status.zoneName, status.owner, status.status)endlocal all = exports['possible_turfs']:GetAllTurfStatuses()for _, status in ipairs(all) do print(status.zoneName, status.owner, status.status)endAlso available as possible_turfs:server:getAllTurfStatuses.
GetLocalTurfStatus
Client export. Same derived status without a server round-trip — reads GlobalState['turf:' .. zoneName].
exports['possible_turfs']:GetLocalTurfStatus(zoneName)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
zoneName | string | ✅ | Turf zone name |
Returns
| Type | Description |
|---|---|
table|nil | Status table (no coords / radius), or nil if GlobalState has nothing for that zone |
Live updates
When bomb plant / defuse / explode / cooldown / admin reset happens, clients get:
RegisterNetEvent('possible_turfs:client:turfStatusChanged', function(payload) -- payload.zoneName, payload.statusend)