# Supported FFA Scripts

> Integrate supported FFA and faction-fight scripts with the Sky Police Job officer down and shots fired dispatch alerts.

## Supported scripts

Sky Police Job supports the following FFA, paintball, and faction-fight integrations through
`Config.Functions.beforeDispatchAlert`.

The integration prevents automatic **Officer down** and **Shots fired** dispatch alerts while the
player is participating in an FFA or faction fight. Outside these modes, the normal dispatch
settings, chance, ignored weapons, cooldowns, and duty checks still apply.

### nass_paintball

- **Mode:** Paintball
- **Resource:** `nass_paintball`
- **State export:** `exports["nass_paintball"]:inGame()`

Officer down and shots fired alerts are blocked while `inGame()` returns `true`.

### pug-paintball

- **Mode:** Paintball
- **Resource:** `pug-paintball`
- **State export:** `exports["pug-paintball"]:IsInPaintball()`

Officer down and shots fired alerts are blocked while `IsInPaintball()` returns `true`.

### hex_ffa

- **Mode:** FFA zone
- **Resource:** `hex_ffa`
- **State export:** `exports["hex_ffa"]:isInZone()`

Officer down and shots fired alerts are blocked while `isInZone()` returns `true`.

### hex_3_ffa

- **Mode:** FFA zone
- **Resource:** `hex_3_ffa`
- **State export:** `exports["hex_3_ffa"]:isInZone()`

Officer down and shots fired alerts are blocked while `isInZone()` returns `true`.

### hex_4_ffa

- **Mode:** FFA zone
- **Resource:** `hex_4_ffa`
- **State export:** `exports["hex_4_ffa"]:isInZone()`

Officer down and shots fired alerts are blocked while `isInZone()` returns `true`.

### ws_ffa

- **Mode:** FFA zone
- **Resource:** `ws_ffa`
- **State export:** `exports["ws_ffa"]:isInZone()`

Officer down and shots fired alerts are blocked while `isInZone()` returns `true`.

### ws_ffa-v2

- **Mode:** FFA zone
- **Resource:** `ws_ffa-v2`
- **State export:** `exports["ws_ffa-v2"]:isInZone()`

Officer down and shots fired alerts are blocked while `isInZone()` returns `true`.

### ws_gangwar-v2

- **Mode:** Gangwar
- **Resource:** `ws_gangwar-v2`
- **State export:** `exports["ws_gangwar-v2"]:isFightActive()`

Officer down and shots fired alerts are blocked while `isFightActive()` returns `true`.

### sp_ffa

- **Mode:** FFA
- **Resource:** `sp_ffa`
- **State export:** `exports["sp_ffa"]:inFFA()`

Officer down and shots fired alerts are blocked while `inFFA()` returns `true`.

### sp_frakfights

- **Mode:** Faction fight
- **Resource:** `sp_frakfights`
- **State export:** `exports["sp_frakfights"]:IsFrakFight()`

Officer down and shots fired alerts are blocked while `IsFrakFight()` returns `true`.

## Generate the functions.lua hook

Select the scripts installed on your server. The generator prepares the complete hook block for
`sky_policejob/config/functions.lua`.

<steps>

### Open the original functions.lua

Open `sky_policejob/config/functions.lua`. Do not delete or replace the complete file.

### Find the replacement start

Start at the comment directly above this function:

```lua
Config.Functions.beforeDispatchAlert = function(context)
```

If the function is missing, update Sky Police Job first. The dispatch flow must support the hook
before the generated configuration can take effect.

### Find the replacement end

The replacement ends after the closing `end` of `Config.Functions.beforeDispatchAlert`.
Keep all code after that closing `end`, including garage helpers and the other functions.

### Generate and paste

Select the installed scripts below, copy the generated configuration, and replace only the marked
`beforeDispatchAlert` section. Restart `sky_policejob` after saving `functions.lua`.

</steps>

<ffa-script-generator job="police">



</ffa-script-generator>

<warning>

Keep `Config.Functions.HasDispatch`, `Config.Functions.CreateDispatch`,
`Config.Functions.OpenImpoundForm`, `Config.Functions.StoreVehicle`, and every other function
outside the marked replacement range unchanged.

</warning>

Returning `false` from `beforeDispatchAlert` suppresses the current automatic officer down or shots
fired alert. The hook runs on the affected player's client, so it can use the same FFA state exports
as the Ambulance integration. It is read again for each eligible alert; do not cache the result of
an FFA export outside the function.

The generated resource-state checks ensure that only installed and running integrations are called.
Each selected mode is checked independently: being outside one running FFA does not prevent an
active gangwar or another selected mode from blocking the alerts.

## Job Configurator and alert types

The Lua hook stays in `config/functions.lua` even when `/jobconfig` is enabled. Continue using
**Police Jobs → Dispatch** for the ordinary officer down and shots fired settings. Restart the
resource after changing Lua code; normal saved dispatch settings still apply live.

The generated hook blocks both automatic alert types. For a custom filter, the context provides:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        context.alertType
      </code>
    </td>
    
    <td>
      <code>
        "officerDown"
      </code>
      
       or <code>
        "shotsFired"
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        context.playerPed
      </code>
    </td>
    
    <td>
      The local player's current ped handle.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        context.weaponHash
      </code>
    </td>
    
    <td>
      The weapon hash for shots fired; absent for officer down.
    </td>
  </tr>
</tbody>
</table>

Keep custom checks synchronous. A blocked shots fired alert does not consume the dispatch cooldown.
Officer down is still limited to an on-duty police officer and is sent at most once for the same
death. The hook controls these automatic alerts; other dispatch creation keeps its existing flow.

## Using Sky Ambulance Job alongside Police Job

The Police hook controls dispatch alerts. To also suppress the Ambulance death screen and injuries,
configure the [Ambulance FFA hooks](/docs/jobs/ambulancejob/reference/supported-ffa-scripts).
Servers using `sp_ffa` with Sky Ambulance Job should also follow that page's
[revive callback instructions](/docs/jobs/ambulancejob/reference/supported-ffa-scripts#sp_ffa-update-the-revive-callback).

## Support

Need help? Our support team is always ready to assist

<u-button color="neutral" icon="i-simple-icons-discord" label="Join Discord" target="_blank" to="https://discord.gg/sky-systems" variant="subtle">



</u-button>
