Exports

Server and client exports for Possible Turfs.

Important

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.

Lua
exports['possible_turfs']:GetTurfStatus(zoneName)

Parameters

NameTypeRequiredDescription
zoneNamestring✅Turf zone name from config (e.g. "Kortz Center")

Returns

TypeDescription
table|nilStatus table, or nil if the zone is unknown
Lua
{    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

Lua
local status = exports['possible_turfs']:GetTurfStatus('Kortz Center')if status and status.status == 'contested' then    print(status.plantingGang, 'planted a bomb')end

Same data is also available via ox_lib callback possible_turfs:server:getTurfStatus.

GetAllTurfStatuses

Server export. Same shape as above, for every active turf.

Lua
exports['possible_turfs']:GetAllTurfStatuses()

Parameters

None.

Returns

TypeDescription
tableArray of status tables
Lua
local all = exports['possible_turfs']:GetAllTurfStatuses()for _, status in ipairs(all) do    print(status.zoneName, status.owner, status.status)end

Also available as possible_turfs:server:getAllTurfStatuses.

GetLocalTurfStatus

Client export. Same derived status without a server round-trip — reads GlobalState['turf:' .. zoneName].

Lua
exports['possible_turfs']:GetLocalTurfStatus(zoneName)

Parameters

NameTypeRequiredDescription
zoneNamestring✅Turf zone name

Returns

TypeDescription
table|nilStatus 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:

Lua
RegisterNetEvent('possible_turfs:client:turfStatusChanged', function(payload)    -- payload.zoneName, payload.statusend)
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