forked from Simnation/Main
Update client.lua
This commit is contained in:
parent
99c6378780
commit
cf0cbc3262
1 changed files with 10 additions and 4 deletions
|
@ -174,7 +174,7 @@ function StartShishaSmoking(selectedShisha)
|
|||
|
||||
-- Create a separate thread to keep the animation playing
|
||||
local smokingActive = true
|
||||
local smokeThread = CreateThread(function()
|
||||
CreateThread(function()
|
||||
-- Play animation and keep it playing
|
||||
while smokingActive do
|
||||
if not IsEntityPlayingAnim(ped, animDict, animName, 3) then
|
||||
|
@ -185,7 +185,6 @@ function StartShishaSmoking(selectedShisha)
|
|||
end)
|
||||
|
||||
-- Create smoke effect
|
||||
local smokeEffect = nil
|
||||
CreateThread(function()
|
||||
RequestNamedPtfxAsset("core")
|
||||
while not HasNamedPtfxAssetLoaded("core") do
|
||||
|
@ -212,11 +211,18 @@ function StartShishaSmoking(selectedShisha)
|
|||
smokingActive = false
|
||||
ClearPedTasks(ped)
|
||||
|
||||
-- NOW apply effects and show message AFTER smoking is complete
|
||||
-- Warte einen kurzen Moment, um sicherzustellen, dass alle Threads beendet sind
|
||||
Wait(500)
|
||||
|
||||
-- JETZT erst die Effekte anwenden und Nachricht anzeigen
|
||||
Debug("Rauchen vollständig abgeschlossen")
|
||||
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
|
||||
TriggerServerEvent('hud:server:RelieveStress', math.random(15, 25))
|
||||
|
||||
-- Warte noch einen Moment, bevor die Entspannungsnachricht angezeigt wird
|
||||
Wait(1000)
|
||||
QBCore.Functions.Notify("Du fühlst dich entspannt...", "success")
|
||||
Debug("Rauchen abgeschlossen, Entspannungseffekte angewendet")
|
||||
Debug("Entspannungseffekte angewendet")
|
||||
end, function() -- Cancelled
|
||||
-- Clean up if cancelled
|
||||
smokingActive = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue