Browse docs

Server: RemoveOilSpill(spillId, reason)

Reference for Server: RemoveOilSpill(spillId, reason) in firejob.

All exports

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

RemoveOilSpill(spillId, reason)

Immediately removes an active spill and synchronizes the removal. Get spillId from the second return value of CreateOilSpill (spill.id), or from an entry returned by GetOilSpills().

ArgumentTypeRequired / defaultMeaning
spillIdstring or numberRequiredThe spill's id, such as "17"; not a vehicle ID, plate, or array index
reasonstring"export_removed"Removal reason, for example "incident_finished" or "scene_reset"

Returns one boolean: true when an active spill was removed, or false if no spill exists for that ID or an ID reset is in progress. There is no second error string. Removing the same spill twice normally returns true and then false.

The complete creation example shows where the ID comes from. If your resource needs to find its active spills again, use their origin tag:

-- server.lua; matches the source tag used in the creation example.
for _, spill in ipairs(exports["sky_firejob"]:GetOilSpills()) do
    if spill.source == "my_incident_resource" then
        local removed = exports["sky_firejob"]:RemoveOilSpill(spill.id, "scene_reset")
        print(("Remove oil spill %s: %s"):format(spill.id, tostring(removed)))
    end
end

This example removes all active spills with that tag. Use the individual saved ID to remove only one. Direct export removal does not perform the absorbent/broom interaction or consume cleanup items. Reserve "cleaned" for normal cleanup completion: that reason can trigger configured rewards and scenario completion.