> For the complete documentation index, see [llms.txt](https://nayzeee-dev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nayzeee-dev.gitbook.io/docs/nayzeee-scripts/nayzeee-carwipe/exports.md).

# Exports

***

### Client Exports

<details>

<summary>SendNotification</summary>

Sends a notification using configured system.

```lua
exports['nayzeee-carwipe']:SendNotification(message, type)
```

**Parameters:**

| Parameter | Type   | Description                      |
| --------- | ------ | -------------------------------- |
| `message` | string | Notification text                |
| `type`    | string | `'success'`, `'error'`, `'info'` |

</details>

***

### Server Exports

<details>

<summary>IsWipePaused</summary>

Check if auto-wipes are currently paused.

```lua
local isPaused = exports['nayzeee-carwipe']:IsWipePaused()
```

**Returns:** `boolean`

</details>

<details>

<summary>GetVehicleStats</summary>

Get current vehicle statistics.

```lua
local stats = exports['nayzeee-carwipe']:GetVehicleStats()
```

**Returns:**

```lua
{
    total = number,      -- Total spawned vehicles
    occupied = number,   -- Vehicles with players
    unoccupied = number, -- Empty vehicles
    protected = number   -- Protected vehicles
}
```

</details>

<details>

<summary>ProtectVehicle</summary>

Protect a vehicle from being wiped.

```lua
exports['nayzeee-carwipe']:ProtectVehicle(vehicleNetId)
```

**Parameters:**

| Parameter      | Type   | Description        |
| -------------- | ------ | ------------------ |
| `vehicleNetId` | number | Vehicle network ID |

**Example:**

```lua
-- Protect player's personal vehicle
local vehicle = GetVehiclePedIsIn(GetPlayerPed(playerId), false)
local netId = NetworkGetNetworkIdFromEntity(vehicle)
exports['nayzeee-carwipe']:ProtectVehicle(netId)
```

</details>

<details>

<summary>UnprotectVehicle</summary>

Remove protection from a vehicle.

```lua
exports['nayzeee-carwipe']:UnprotectVehicle(vehicleNetId)
```

**Parameters:**

| Parameter      | Type   | Description        |
| -------------- | ------ | ------------------ |
| `vehicleNetId` | number | Vehicle network ID |

</details>

<details>

<summary>TriggerWipe</summary>

Manually trigger a vehicle wipe.

```lua
exports['nayzeee-carwipe']:TriggerWipe(countdown)
```

**Parameters:**

| Parameter   | Type   | Description                    |
| ----------- | ------ | ------------------------------ |
| `countdown` | number | (Optional) Seconds before wipe |

**Example:**

```lua
-- Immediate wipe
exports['nayzeee-carwipe']:TriggerWipe()

-- Wipe in 30 seconds
exports['nayzeee-carwipe']:TriggerWipe(30)
```

</details>

<details>

<summary>CancelWipe</summary>

Cancel a scheduled wipe.

```lua
exports['nayzeee-carwipe']:CancelWipe()
```

</details>

***

### Integration Examples

#### Protect Job Vehicles

```lua
-- When player spawns a job vehicle, protect it
RegisterNetEvent('job:vehicleSpawned')
AddEventHandler('job:vehicleSpawned', function(vehicleNetId)
    exports['nayzeee-carwipe']:ProtectVehicle(vehicleNetId)
end)
```

#### Admin Wipe Command

```lua
-- Custom admin wipe with longer countdown
RegisterCommand('adminwipe', function(source)
    if IsPlayerAdmin(source) then
        exports['nayzeee-carwipe']:TriggerWipe(60) -- 60 second warning
    end
end, true)
```

#### Event-Based Wipe

```lua
-- Wipe vehicles after restart warning
AddEventHandler('txAdmin:events:scheduledRestart', function(data)
    if data.secondsRemaining <= 120 then
        exports['nayzeee-carwipe']:TriggerWipe(30)
    end
end)
```

#### Vehicle Stats Display

```lua
-- Show stats in admin menu
RegisterCommand('vehiclestats', function(source)
    local stats = exports['nayzeee-carwipe']:GetVehicleStats()
    print(string.format(
        'Vehicles: %d total, %d occupied, %d unoccupied, %d protected',
        stats.total, stats.occupied, stats.unoccupied, stats.protected
    ))
end, true)
```
