49 lines
No EOL
1 KiB
Lua
49 lines
No EOL
1 KiB
Lua
function Notification(title, text, type)
|
|
lib.notify({
|
|
title = title,
|
|
description = text,
|
|
type = type,
|
|
position = 'top',
|
|
})
|
|
end
|
|
|
|
function TextUI(value, text)
|
|
if value then
|
|
lib.showTextUI(text, {
|
|
position = "top-center",
|
|
icon = 'hand',
|
|
style = {
|
|
borderRadius = 0,
|
|
backgroundColor = '#48BB78',
|
|
color = 'white'
|
|
}
|
|
})
|
|
else
|
|
lib.hideTextUI()
|
|
end
|
|
end
|
|
|
|
---------------------------- NetEvents
|
|
RegisterNetEvent('mh_jobgarage:notify')
|
|
AddEventHandler('mh_jobgarage:notify', function(title, text, type)
|
|
Notification(title, text, type)
|
|
end)
|
|
|
|
function IsVehicleSpawned(plate)
|
|
|
|
local vehicles = GetGamePool('CVehicle')
|
|
|
|
for _, vehicle in ipairs(vehicles) do
|
|
if DoesEntityExist(vehicle) then
|
|
local mods = QBCore.Functions.GetVehicleProperties(vehicle)
|
|
local vehiclePlate = mods.plate
|
|
|
|
if vehiclePlate == plate then
|
|
print("Function: "..mods)
|
|
return true, mods
|
|
end
|
|
end
|
|
end
|
|
|
|
return false, nil -- Vehicle not found
|
|
end |