JL Store
  • jl_illegalphone
    • Config
    • Exports & Events
      • Server Exports
  • jl_parkingticketjob
    • Installation
    • Config
  • jl_breathalyzer
    • Exports & Events
      • Exports
      • Events
    • Config
  • jl_spectatemenu
    • config.lua
    • config.json
  • jl_dutypanel
    • config.lua
    • cl_main.lua
  • jl_phonetracking
    • config.lua
  • jl_lib
    • Export
    • Server Exports
    • Client Exports
    • Callbacks
  • jl_reports
    • Installation
Powered by GitBook
On this page
  1. jl_breathalyzer
  2. Exports & Events

Exports

Exports for getting players permille or updating it.

Lowering a players permille by identifier

exports['jl_breathalyzer']:lowerPermille(permille, identifier)

Updating a players permille by identifier

exports['jl_breathalyzer']:UpdatePermille(permille, identifier)

Getting a players permille by source

exports['jl_breathalyzer']:GetPermille(source)

Examples:

Here is an example of lowering a players permille by using a export above

function ConsumedItemForDecrease()
    if consumed then
        local permille = 1 -- This will lower the permille
        local identifier = QBCore.Functions.GetIdentifier(source, 'license') -- This will get the players license from source
        exports['jl_breathalyzer']:lowerPermille(permille, identifier)
    end
end

Here is an example of updating a players permille by using a export above

QBCore.Functions.CreateUseableItem("vodka", function(source, item)
    local Player = QBCore.Functions.GetPlayer(source)
    local permille = 0.2
    local identifier = QBCore.Functions.GetIdentifier(source, 'license')

	if Player.Functions.GetItemBySlot(item.slot) ~= nil then
        exports['jl_breathalyzer']:UpdatePermille(permille, identifier)
    end
end)

Here is an example of getting a players permille by using a export above

RegisterCommand('getPlayerPermille', function()
    local src = source
    local permille = exports['jl_breathalyzer']:GetPermille(src)
    print(permille)
end)
PreviousExports & EventsNextEvents

Last updated 1 year ago