> For the complete documentation index, see [llms.txt](https://bytexcripts.gitbook.io/bytexcripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bytexcripts.gitbook.io/bytexcripts-docs/sell-drugs/custom-functions.md).

# Custom Functions

<div align="left"><figure><img src="/files/J7SUjkB12hweOAOOzX39" alt="" width="18"><figcaption></figcaption></figure></div>

Hemos añadido dos funciones custom en el cliente y en el servidor las cuales **no se puede cambiar el nombre** de las mismas ya que eso afectaría al código principal. Aquí le dejamos un poco más de información para que sepa que añadir dentro de las funciones:

{% code title="client/custom-functions.lua" %}

```lua
customNotificationFunction(message)
```

{% endcode %}

* El parámetro `message` es el mensaje que aparece en la notificación, eso significa que en el export o evento que utilice su servidor para enseñar las notificaciones, deberá pasar `message` como el mensaje.

{% code title="client/custom-functions.lua" %}

```lua
customPoliceAlert(coords)
```

{% endcode %}

* El parámetro `coords` son las coordenadas desde donde se avisa a la policía, para que así se pueda marcar en el mapa la ubicación del aviso.

{% code title="server/custom-functions.lua" %}

```lua
customNotificationFunction(src, message)
```

{% endcode %}

* El parámetro `src` es el jugador al que se le debe mandar la notificación, de esa manera solo recibirá la notificación el jugador que debe recibirla.
* El parámetro `message` es el mensaje que aparece en la notificación, eso significa que en el export o evento que utilice su servidor para enseñar las notificaciones, deberá pasar `message` como el mensaje.

{% code title="server/custom-functions.lua" %}

```lua
customInventoryFunction(src, item, quantity)
```

{% endcode %}

* El parámetro `src` es el jugador al que se le debe mandar la notificación, de esa manera solo recibirá la notificación el jugador que debe recibirla.
* El parámetro `item` se refiere al item que se tiene que actualizar en el inventario, ya sea añadir o eliminar.
* El parámetro `quantity` se refiere a la cantidad que tiene que actualizar de ese mismo item, ya sea la cantidad que se haya que quitar o añadir.

<div align="left"><figure><img src="/files/bVJIxvEgfTGJYhZYQjJN" alt="" width="18"><figcaption></figcaption></figure></div>

We have added two custom functions on the client and on the server, which cannot be renamed as this would affect the main code. Here is a little more information so you know what to add to the functions:

{% code title="client/custom-functions.lua" %}

```lua
customNotificationFunction(message)
```

{% endcode %}

* The `message` parameter is the message that appears in the notification, that means that in the export or event that your server uses to show the notifications, you must pass `message` as the message.

{% code title="client/custom-functions.lua" %}

```lua
customPoliceAlert(coords)
```

{% endcode %}

* The `coords` parameter is the coordinates from where the police are notified, so that the location of the notice can be marked on the map.

{% code title="server/custom-functions.lua" %}

```lua
customNotificationFunction(src, message)
```

{% endcode %}

* The `src` parameter is the player to whom the notification should be sent, that way only the player who should receive the notification will receive it.
* The `message` parameter is the message that appears in the notification, that means that in the export or event that your server uses to show the notifications, you must pass `message` as the message.

{% code title="server/custom-functions.lua" %}

```lua
customInventoryFunction(src, item, quantity)
```

{% endcode %}

* The `src` parameter is the player to whom the notification should be sent, that way only the player who should receive it will receive the notification.
* The `item` parameter refers to the item that has to be updated in the inventory, whether it is added or removed.
* The `quantity` parameter refers to the quantity that has to be updated of that same item, whether it is the quantity that has to be removed or added.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://bytexcripts.gitbook.io/bytexcripts-docs/sell-drugs/custom-functions.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.
