# Functions/Events

### `function crossNotify(msg)`

**Description**: This function is used to send a notification message to the player. It supports both QBCore and ESX frameworks, ensuring compatibility based on the server configuration.

#### Parameters:

* **msg**: The message string to be displayed in the notification.

#### Functionality:

* If the server is using the **QBCore** framework:
  * It calls `Config.QBCore.Functions.Notify(msg)` to display the notification.
* If the server is using the **ESX** framework:
  * It triggers the `esx:showAdvancedNotification` event to display an advanced notification.

#### Example Usage:

```lua
crossNotify("Security access has been granted.")
```

***

### `function fillFuel(vehicle)`

**Description**: This function refills the fuel of a specified vehicle to 100%.

#### Parameters:

* **vehicle**: The vehicle entity to be refueled.

#### Functionality:

1. Sets the vehicle's fuel level to `100.0` using `SetVehicleFuelLevel`.
2. Synchronizes the fuel level with the `DecorSetFloat` function, using the decorator key `"_FUEL_LEVEL"` and the current fuel level from `GetVehicleFuelLevel`.

#### Example Usage:

```lua
luaCopy codelocal playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
fillFuel(playerVehicle)
```

#### Notes:

* Ensure that the `_FUEL_LEVEL` decorator is initialized and registered in your script for proper functionality.
* This function is useful for administrative tools or mechanics scripts to refuel vehicles programmatically.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enyo-scripts.gitbook.io/documentations/fivem-scripts/ai-guards/functions-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
