forked from Simnation/Main
resources/[Developer]/[Max]/ticketpanel_qb/client/cl_main.lua aktualisiert
Sound Ende umgestellt Signed-off-by: Max <max@evolution-state-life.de>
This commit is contained in:
parent
5ef835419c
commit
cc4175c56e
1 changed files with 4 additions and 4 deletions
|
@ -75,7 +75,7 @@ RegisterNetEvent('rlo_ticketpanel:client:syncRequest', function(activeTickets, n
|
|||
if Config.Sound.Enabled then
|
||||
print('Sound is enabled, trying to play sound...')
|
||||
|
||||
-- Prüfe, ob xSound gestartet ist
|
||||
-- Prüfe, ob xSound gestartet ist
|
||||
local xsoundState = GetResourceState('xsound')
|
||||
print('xSound resource state: ' .. xsoundState)
|
||||
|
||||
|
@ -86,15 +86,15 @@ RegisterNetEvent('rlo_ticketpanel:client:syncRequest', function(activeTickets, n
|
|||
print('Sound URL: ' .. Config.Sound.URL)
|
||||
print('Sound Volume: ' .. Config.Sound.Volume)
|
||||
|
||||
-- Eindeutige Sound-ID für jede Benachrichtigung
|
||||
-- Eindeutige Sound-ID für jede Benachrichtigung
|
||||
local soundId = 'ticket_notify_' .. math.random(100000, 999999)
|
||||
|
||||
-- Direkter Aufruf ohne pcall für bessere Fehlermeldungen
|
||||
-- Direkter Aufruf ohne pcall für bessere Fehlermeldungen
|
||||
print('Trying to play sound with direct method...')
|
||||
exports['xsound']:PlayUrl(soundId, Config.Sound.URL, Config.Sound.Volume, false)
|
||||
|
||||
-- Sound nach 10 Sekunden stoppen
|
||||
Citizen.SetTimeout(1500, function()
|
||||
Citizen.SetTimeout(2000, function()
|
||||
if exports['xsound']:soundExists(soundId) then
|
||||
exports['xsound']:Destroy(soundId)
|
||||
print('Sound stopped after 10 seconds timeout')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue