forked from Simnation/Main
Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
commit
6d6d62dffe
1 changed files with 50 additions and 30 deletions
|
@ -1,30 +1,50 @@
|
||||||
function Notification(title, text, type)
|
function Notification(title, text, type)
|
||||||
lib.notify({
|
lib.notify({
|
||||||
title = title,
|
title = title,
|
||||||
description = text,
|
description = text,
|
||||||
type = type,
|
type = type,
|
||||||
position = 'top',
|
position = 'top',
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function TextUI(value, text)
|
function TextUI(value, text)
|
||||||
if value then
|
if value then
|
||||||
lib.showTextUI(text, {
|
lib.showTextUI(text, {
|
||||||
position = "top-center",
|
position = "top-center",
|
||||||
icon = 'hand',
|
icon = 'hand',
|
||||||
style = {
|
style = {
|
||||||
borderRadius = 0,
|
borderRadius = 0,
|
||||||
backgroundColor = '#48BB78',
|
backgroundColor = '#48BB78',
|
||||||
color = 'white'
|
color = 'white'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
lib.hideTextUI()
|
lib.hideTextUI()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------- NetEvents
|
---------------------------- NetEvents
|
||||||
RegisterNetEvent('mh_jobgarage:notify')
|
RegisterNetEvent('mh_jobgarage:notify')
|
||||||
AddEventHandler('mh_jobgarage:notify', function(title, text, type)
|
AddEventHandler('mh_jobgarage:notify', function(title, text, type)
|
||||||
Notification(title, text, type)
|
Notification(title, text, type)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
function IsVehicleSpawned(plate)
|
||||||
|
plate = string.gsub(string.upper(plate), '^%s*(.-)%s*$', '%1'):gsub(' ', '')
|
||||||
|
|
||||||
|
local vehicles = GetAllVehicles()
|
||||||
|
|
||||||
|
for _, vehicle in ipairs(vehicles) do
|
||||||
|
if DoesEntityExist(vehicle) then
|
||||||
|
local vehiclePlate = QBCore.Functions.GetPlate(vehicle)
|
||||||
|
local mods = QBCore.Functions.GetVehicleProperties(vehicle)
|
||||||
|
vehiclePlate = string.gsub(string.upper(vehiclePlate), '^%s*(.-)%s*$', '%1'):gsub(' ', '')
|
||||||
|
|
||||||
|
if vehiclePlate == plate then
|
||||||
|
return true, mods
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false, nil -- Vehicle not found
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue