Inicio › Documentación › Instalación · origen_notify

Instalación · origen_notify

1. Añádelo al server.cfg

text
ensure origen_notify

origen_notify debe arrancar antes que cualquier recurso que llame a sus exports. Colócalo pronto en tu server.cfg, después de /assetpacks.


2. Integración con el framework

origen_notify no se engancha solo a ningún framework. Tienes que parchear a mano el recurso del framework para que sus funciones internas de notificación y drawtext deleguen en origen_notify.

QBCore

Abre qb-core/client/drawtext.lua.

Paso 1: comenta las funciones hideText y drawText existentes y añade lo siguiente al principio del fichero:

lua
local __buffer = {}
 
local function hideText()
    for k, v in pairs(__buffer) do
        exports["origen_notify"]:RemoveHelp(v)
        __buffer[k] = nil
    end
end
 
local function drawText(text, position)
    local key = ""
    local formattedText = text or ""
 
    if string.find(formattedText, "%[.-%]") then
        key, formattedText = string.match(formattedText, "%[(.)%](.+)")
    end
 
    __buffer[text] = exports["origen_notify"]:CreateHelp(key, formattedText or text)
end

Paso 2: sustituye el cuerpo de QBCore.Functions.Notify por:

lua
exports["origen_notify"]:ShowNotification(message, type, length)

ESX

Por ahora no hay un parche oficial. Usa los exports del cliente directamente en tus recursos personalizados.


3. No requiere SQL

origen_notify no tiene tablas en la base de datos. No hay SQL que ejecutar.