Browse docs
Server: GetOilSpills()
Reference for Server: GetOilSpills() in firejob.
Optional developer integration. Call this export from a server script in your own resource after sky_firejob has started. For normal installation and gameplay, use Installation.
Server Exports
GetOilSpills()
Takes no arguments and returns an array of all currently active server-side spills, including both fresh and bound spills. Each entry has the fields documented under CreateOilSpill. When there are no active spills, the result is an empty table {}.
-- server.lua
local spills = exports["sky_firejob"]:GetOilSpills()
for _, spill in ipairs(spills) do
print(("Spill %s: state=%s, source=%s, position=%.2f, %.2f, %.2f"):format(
spill.id,
spill.state,
spill.source,
spill.coords.x,
spill.coords.y,
spill.coords.z
))
end
Use spill.id as the removal ID. The position of an entry in this array can change as spills are added or removed. Re-query when you need current state; editing a returned table is not a supported update API.