⚙️Exports | Events

Notifications

To use our built-in notifications use these exports 👇

-- Client Side
exports['LuxuAdmin']:Notify(msg,type,duration,sound)

-- Server Side
exports['LuxuAdmin']:Notify(src,msg,type,duration,sound)

-- Params
src: number | string
msg: string
type: string
duration: number (ms)
sound?: boolean

-- Available types
local types = {
      'success', --[[ 🟢 ]]
      'error', --[[ 🔴 ]]
      'info', --[[ 🔵 ]]
      'warning', --[[ 🟡 ]]
}

-- Example usage on client side
exports['LuxuAdmin']:Notify("Hello friend","info",3000,true)

Admin duty toggled

Server Side
RegisterNetEvent('LuxuAdmin:Server:ToggleDuty',function(src, duty)
local source = tostring(src) -- Convert number to string

if duty then -- Duty is on
--- Your code here
else -- Duty is off
--- Your code here
end

end)

Warning Received

Server Side
---@param data {src: number, reason: string, received_ban: boolean, count: number, identifiers:string[]} 
AddEventHandler("LuxuAdmin:Server:PlayerWarned",function (data)
      local discordId 
      for _, id in ipairs(data.identifiers)do
            if id:find("discord:") then
                  discordId = id:gsub("discord:","")
                  break
            end
      end
      print(discordId,"has been warned for",data.reason)
      print("Received ban?",data.received_ban)
end)

Player Banned

Server Side
---@param data {src:number, reason:string, expiration:number, identifiers:string[], hwids:string[]}
AddEventHandler("LuxuAdmin:Server:PlayerBanned",function (data)
      
end)

Last updated