forked from Simnation/Main
ed
This commit is contained in:
parent
00910d1237
commit
0f392143e5
11 changed files with 329 additions and 14 deletions
|
@ -712,32 +712,57 @@ RegisterNetEvent('vending:client:startRobbery', function(coords)
|
|||
end
|
||||
end)
|
||||
|
||||
-- Police alert
|
||||
RegisterNetEvent('vending:client:policeAlert', function(coords, streetName)
|
||||
local alert = {
|
||||
title = "Verkaufsautomat Aufbruch",
|
||||
coords = coords,
|
||||
description = "Ein Verkaufsautomat wird aufgebrochen in " .. streetName
|
||||
}
|
||||
-- Police alert with ox_lib notification and blinking blip
|
||||
RegisterNetEvent('vending:client:policeAlert', function(alertData)
|
||||
-- Extract data
|
||||
local coords = alertData.coords
|
||||
local locationName = alertData.locationName
|
||||
|
||||
-- Add blip
|
||||
-- Create a blinking blip
|
||||
local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
|
||||
SetBlipSprite(blip, 161)
|
||||
SetBlipColour(blip, 1)
|
||||
SetBlipScale(blip, 1.0)
|
||||
SetBlipSprite(blip, 161) -- Robbery icon
|
||||
SetBlipColour(blip, 1) -- Red color
|
||||
SetBlipScale(blip, 1.2)
|
||||
SetBlipAsShortRange(blip, false)
|
||||
|
||||
-- Make the blip flash
|
||||
SetBlipFlashes(blip, true)
|
||||
SetBlipFlashInterval(blip, 200) -- Flash interval in milliseconds
|
||||
|
||||
-- Set blip name
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString("Verkaufsautomat Aufbruch")
|
||||
EndTextCommandSetBlipName(blip)
|
||||
|
||||
-- Create route to the robbery
|
||||
SetBlipRoute(blip, true)
|
||||
SetBlipRouteColour(blip, 1) -- Red route
|
||||
|
||||
-- Show ox_lib notification
|
||||
if lib and lib.notify then
|
||||
lib.notify({
|
||||
title = 'Verkaufsautomat Aufbruch',
|
||||
description = 'Ein Verkaufsautomat wird aufgebrochen bei ' .. locationName,
|
||||
type = 'error',
|
||||
icon = 'fas fa-mask',
|
||||
position = 'top-right',
|
||||
duration = 8000
|
||||
})
|
||||
else
|
||||
-- Fallback to QBCore notification if ox_lib is not available
|
||||
QBCore.Functions.Notify('Verkaufsautomat Aufbruch gemeldet: ' .. locationName, 'error', 8000)
|
||||
end
|
||||
|
||||
-- Play alert sound
|
||||
PlaySound(-1, "Lose_1st", "GTAO_FM_Events_Soundset", 0, 0, 1)
|
||||
|
||||
-- Remove blip after 5 minutes
|
||||
SetTimeout(300000, function()
|
||||
RemoveBlip(blip)
|
||||
end)
|
||||
|
||||
QBCore.Functions.Notify('Verkaufsautomat Aufbruch gemeldet: ' .. streetName, 'error', 8000)
|
||||
end)
|
||||
|
||||
|
||||
-- Management menu (alternative opening method)
|
||||
RegisterNetEvent('vending:client:openManagement', function(machine)
|
||||
-- Fast check for management permissions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue