LibertyCode
LibertyCode
  • Welcome
  • lc_adminmenu
    • Introduction
    • Installation
    • Avatars
    • Screenshots
    • Bridge
      • Server
      • Client
    • Player functions
    • Permissions
      • Permission Groups
      • Discord Permissions
    • Exports
Powered by GitBook
On this page
  • GetOwnedVehicleLabel
  • SuccessNotify
  • InfoNotify
  • FailNotify
  1. lc_adminmenu
  2. Bridge

Client

PreviousServerNextPlayer functions

Last updated 1 year ago

GetOwnedVehicleLabel

data is SQL query result from Bridge.GetOwnedVehicles function.

---@param data any
---@return string
GetOwnedVehicleLabel = function(data)
    local model = json.decode(data.vehicle).model
    return GetLabelText(GetDisplayNameFromVehicleModel(model))
end

SuccessNotify

---@param title? string
---@param description? string
---@param id? string
SuccessNotify = function(title, description, id)
    local data = {
      position = 'top',
      style = {
          width = 'fit-content',
          backgroundColor = '#000000',
          borderRadius = '0.5rem',
          color = '#ffffff',
          ['.description'] = {
            color = '#cccccc'
          }
      },
      icon = 'check',
      iconColor = '#3fad00'
    }
    data.title = title or nil
    data.description = description or nil
    data.id = id or nil

    lib.notify(data)
  end

InfoNotify

---@param title? string
---@param description? string
---@param id? string
InfoNotify = function(title, description, id)
    local data = {
      position = 'top',
      style = {
          width = 'fit-content',
          backgroundColor = '#000000',
          borderRadius = '0.5rem',
          color = '#ffffff',
          ['.description'] = {
            color = '#cccccc'
          }
      },
      icon = 'info',
      iconColor = '#4287f5'
    }
    data.title = title or nil
    data.description = description or nil
    data.id = id or nil

    lib.notify(data)
  end

FailNotify

---@param title? string
---@param description? string
---@param id? string
FailNotify = function(title, description, id)
  local data = {
    position = 'top',
    style = {
        width = 'fit-content',
        backgroundColor = '#000000',
        borderRadius = '0.5rem',
        color = '#ffffff',
        ['.description'] = {
          color = '#cccccc'
        }
    },
    icon = 'ban',
    iconColor = '#C53030'
  }
  data.title = title or nil
  data.description = description or nil
  data.id = id or nil

  lib.notify(data)
end
GetOwnedVehicles