> 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/events.md).

# Events

***

### Client Events

<details>

<summary>carwipe:notify</summary>

Sends a notification to the player.

```lua
TriggerClientEvent('carwipe:notify', playerId, message, type)
```

**Parameters:**

| Parameter  | Type   | Description                                   |
| ---------- | ------ | --------------------------------------------- |
| `playerId` | number | Player server ID (-1 for all)                 |
| `message`  | string | Notification message                          |
| `type`     | string | `'success'`, `'error'`, `'info'`, `'warning'` |

</details>

***

### Server Events

<details>

<summary>carwipe:wipeStarting</summary>

Triggered when a wipe countdown begins.

```lua
AddEventHandler('carwipe:wipeStarting', function(countdown)
    print('Wipe starting in ' .. countdown .. ' seconds')
end)
```

**Parameters:**

| Parameter   | Type   | Description        |
| ----------- | ------ | ------------------ |
| `countdown` | number | Seconds until wipe |

</details>

<details>

<summary>carwipe:wipeComplete</summary>

Triggered when a wipe is completed.

```lua
AddEventHandler('carwipe:wipeComplete', function(vehiclesDeleted, totalBefore)
    print('Wiped ' .. vehiclesDeleted .. ' vehicles')
end)
```

**Parameters:**

| Parameter         | Type   | Description                |
| ----------------- | ------ | -------------------------- |
| `vehiclesDeleted` | number | Number of vehicles deleted |
| `totalBefore`     | number | Vehicle count before wipe  |

</details>

<details>

<summary>carwipe:wipeCancelled</summary>

Triggered when a scheduled wipe is cancelled.

```lua
AddEventHandler('carwipe:wipeCancelled', function()
    print('Vehicle wipe cancelled')
end)
```

</details>

***

### Usage Example

```lua
-- Listen for wipe events in your script
AddEventHandler('carwipe:wipeStarting', function(countdown)
    -- Save important vehicle data before wipe
    SavePlayerVehicles()
end)

AddEventHandler('carwipe:wipeComplete', function(deleted)
    -- Log or handle post-wipe
    print('Cleaned up ' .. deleted .. ' abandoned vehicles')
end)
```
