Codeo Scripts
  • 📖 Welcome
  • INFORMATION
    • 🔐 Setting Steam Api Key
    • 🔑 CFX Auth System
    • 🔓 Escrow/Open Source
    • 🥺 You lack the required entitlement
  • SCRIPTS
    • Codeo-LoadingScreen
      • Installation
      • Adjustments
    • Codeo-Notification
      • Installation
      • Adjustments
    • Codeo-SpawnSelector
      • Installation
      • Adjustments
      • Integrations
    • Codeo-BlackMarket
      • Installation
      • Adjustments
      • Discord Bot Settings
Powered by GitBook
On this page
  • Installation
  • Step 1 - Drag And Drop
  • Step 2 - SQL Configuration
  • Integrating Notifications For ESX Framework
  • Step 1 - Edit Functions Lua
  • Step 2 - Find Function
  • Step 3 - Replace Code
  • Integrating Nofitications For QB Framework
  • Step 1 - Edit Functions Lua
  • Step 2 - Find Function
  • Step 3 - Replace Code
  • Information
  • Notification types
  1. SCRIPTS
  2. Codeo-Notification

Installation

Codeo-Notification Installation

PreviousCodeo-NotificationNextAdjustments

Last updated 2 months ago


Installation

Step 1 - Drag And Drop

  • Drag Codeo-Notification into your resources foder.

Step 2 - SQL Configuration

  • Select the sql you're using options are "oxmysql, ghmattimysql, mysql-async" from config.


Integrating Notifications For ESX Framework

Step 1 - Edit Functions Lua

  • Go to "es_extended/client/functions.lua"

Step 2 - Find Function

  • Find "ESX.ShowNotification" function.

Step 3 - Replace Code

  • Replace "ESX.ShowNotification" function with the code down below.

Copy

function ESX.ShowNotification(msg, texttype, length)
    local convert = {
        ["primary"] = 'info',
        ["police"] = 'lspd',
        ["ambulance"] = 'ems',
    }
    if not texttype then
        texttype = 'info'
    end
    if convert[texttype] then
        texttype = convert[texttype]
    end
    length = length or 5000
    TriggerEvent('codeo-notification', nil, msg, texttype, length)
end

Integrating Nofitications For QB Framework

Step 1 - Edit Functions Lua

  • Go to "qb-core/client/functions.lua"

Step 2 - Find Function

  • Find "QBCore.Functions.Notify" function.

Step 3 - Replace Code

  • Replace "QBCore.Functions.Notify" function with the code down below.

Copy

function QBCore.Functions.Notify(text, texttype, length)
    local convert = {
        ["primary"] = 'info',
        ["police"] = 'lspd',
        ["ambulance"] = 'ems',
    }
    if not texttype then
        texttype = 'info'
    end

    if convert[texttype] then
        texttype = convert[texttype]
    end

    if type(text) == "table" then
        local answer = text.text or 'Placeholder'
        local caption = text.caption or 'Placeholder'
        length = length or 5000
        TriggerEvent('codeo-notification', answer, caption, texttype, length)
    else
        length = length or 5000
        TriggerEvent('codeo-notification', nil, text, texttype, length)
    end
end

Information

Information - 1 How to use events or exports

If you want to trigger the notification from the client side you can use the example down below According to this example.

  • 1st parameter is the title of the notification.

  • 2nd parameter is the text you want to display in the notification.

  • 3rd parameter is the notification type (more types can be find in notification types category).

  • 4th is how long time notification will be displayed on the screen.

TriggerEvent('codeo-notification', 'Header you want to display(you can set this to nil if you want to display default header)', 'the text you want to display', 'success', 3000)
  • If you want to trigger the notification from server side use the example down below Only things change here are TriggerEvent needs to be replaced with TriggerClientEvent and source (id) of a player you want to show notification

TriggerClientEvent('codeo-notification', source, 'Header you want to display(you can set this to nil if you want to display default header)', 'the text you want to display', 'success', 3000)

Notification types

  • success

  • server

  • info

  • error

  • announcement

  • lspd

  • ems

  • lscustoms

  • bennys

Visit Setting notification types to set more notification types.