# Server: RemoveOilSpill(spillId, reason)

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

[All exports](/docs/jobs/firejob/reference/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](/docs/jobs/firejob/setup/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()`.

<table>
<thead>
  <tr>
    <th>
      Argument
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required / default
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        spillId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       or <code>
        number
      </code>
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      The spill's <code>
        id
      </code>
      
      , such as <code>
        "17"
      </code>
      
      ; not a vehicle ID, plate, or array index
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reason
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        "export_removed"
      </code>
    </td>
    
    <td>
      Removal reason, for example <code>
        "incident_finished"
      </code>
      
       or <code>
        "scene_reset"
      </code>
    </td>
  </tr>
</tbody>
</table>

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](/docs/jobs/firejob/reference/exports/server-createoilspill#create-keep-the-id-and-remove-the-spill-later) shows where the ID comes from. If your resource needs to find its active spills again, use their origin tag:

```lua
-- 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.
