# ¿Como vincular Infobox?

#### Parámetros:

**Lado del Servidor:**

* `player`: El jugador al que se enviará la notificación
* `message`: El mensaje que se mostrará
* `type`: El tipo de notificación (success, error, info, warning)
* `duration`: Duración en milisegundos (opcional, por defecto 5000)
* `author`: Autor del mensaje (opcional)

**Lado del Cliente:**

* `message`: El mensaje que se mostrará
* `type`: El tipo de notificación (success, error, info, warning)
* `duration`: Duración en milisegundos (opcional, por defecto 5000)

### Implementación Básica

Para implementar el sistema de manera simple, puedes añadir las siguientes funciones a tu script:

```lua
luaCopiar-- Función para enviar notificación desde el servidor
function notifyS(player, message, type, duration, author)
    duration = duration or 5000  -- Duración predeterminada
    return exports["Infobox_Etvx"]:showInfobox(player, message, type, duration, author)
end

-- Función para enviar notificación desde el cliente
function notifyC(message, type, duration)
    duration = duration or 5000  -- Duración predeterminada
    return exports["Infobox_Etvx"]:showInfobox(message, type, duration)
end
```

### Implementación Avanzada

Para un sistema más completo que pueda integrarse fácilmente con múltiples scripts, puedes crear funciones de notificación reusables en un archivo separado:

```lua
luaCopiar-- notifications.lua
local Notifications = {}

Notifications.sendToPlayer = function(element, message, type, duration)
    duration = duration or 5000  -- Duración predeterminada
    return exports["Infobox_Etvx"]:showInfobox(element, message, type, duration)
end

Notifications.sendToClient = function(message, type, duration)
    duration = duration or 5000  -- Duración predeterminada
    return exports["Infobox_Etvx"]:showInfobox(message, type, duration)
end

return Notifications
```

Esta implementación permite:

* Acceso uniforme a las notificaciones desde cualquier parte de tu código
* Fácil mantenimiento (cambios centralizados)
* Extensibilidad para añadir más funciones relacionadas

### Otro tipo de Implementación&#x20;

```lua
-- Exportacion para usar en sistemas 

 notifyS = function(player, message, type, duration)
     duration = 5000  -- Duracion de la notificacion
     return exports["Infobox_Etvx"]:showInfobox(player, message, type, duration, author)
 end

--- Función para enviar notificación desde el cliente
 notifyC = function(message, type, duration, author)
     duration = 5000 -- Duracion de la notificacion
     return exports["Infobox_Etvx"]:showInfobox(message, type, duration)
 end
```


---

# 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://etvxstore.gitbook.io/etvxstore/como-vincular-infobox.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.
