# Snippets

### ESX

On **es\_extended/client/functions.lua** replace the `function ESX.ShowNotification` with the following one:

```lua
function ESX.ShowNotification(message, type, length)
    if GetResourceState('okokNotify') ~= 'missing' then
        if type == 'error' then
            exports['okokNotify']:Alert("Error", message, 5000, 'error')
        elseif type == 'inform' then
            exports['okokNotify']:Alert("Info", message, 5000, 'info')
        elseif type == 'success' then
            exports['okokNotify']:Alert("Success", message, 5000, 'success')
        elseif type == 'warning' then
            exports['okokNotify']:Alert("Warning", message, 5000, 'warning')
        else
            exports['okokNotify']:Alert("Info", message, 5000, 'info')
        end
    else
        print('[okokNotify]: ERROR: okokNotify resource not FOUND or not STARTED!')
    end
end
```

### QBCore

On **qb-core/client/functions.lua** replace the `function QBCore.Functions.Notify` with the following one:

```lua
function QBCore.Functions.Notify(text, textype, length)
    if textype == 'primary' then textype = 'info' end 
    local ttype = textype ~= nil and textype or "info"
    local length = length ~= nil and length or 5000
    exports['okokNotify']:Alert("", text, length, ttype)
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://docs.okokscripts.io/scripts/okoknotify/snippets.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.
