Client

GetOwnedVehicleLabel

data is SQL query result from Bridge.GetOwnedVehicles function. GetOwnedVehicles

---@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

Last updated