diff --git a/resources/[inventory]/nordi_hookah/client.lua b/resources/[inventory]/nordi_hookah/client.lua index 76adfecc5..827e8ee76 100644 --- a/resources/[inventory]/nordi_hookah/client.lua +++ b/resources/[inventory]/nordi_hookah/client.lua @@ -163,13 +163,15 @@ end function SmokeShisha(selectedShisha) local ped = PlayerPedId() local propName = "v_corp_lngestoolfd" -- Dieses Modell wird von irgendwo auf dem Server geladen - local propBone = 28422 + local propBone = 18905 -- Rechte Hand - local propCoords = vector3(0.0, 0.0, -0.03) - local propRotation = vector3(0.0, 0.0, 0.0) + -- Angepasste Position und Rotation für bessere Platzierung + local propCoords = vector3(0.10, 0.03, 0.05) + local propRotation = vector3(100.0, 0.0, 40.0) - local animDict = "amb@world_human_aa_smoke@male@idle_a" - local animName = "idle_c" + -- Bessere Rauch-Animation + local animDict = "timetable@gardener@smoking_joint" + local animName = "smoke_idle" -- Request model and animation RequestModel(GetHashKey(propName)) @@ -189,6 +191,17 @@ function SmokeShisha(selectedShisha) -- Play animation TaskPlayAnim(ped, animDict, animName, 8.0, -8.0, -1, 49, 0, false, false, false) + -- Füge Raucheffekt hinzu + local smokeParticle = "exp_grd_bzgas_smoke" + RequestNamedPtfxAsset("core") + while not HasNamedPtfxAssetLoaded("core") do + Wait(0) + end + + UseParticleFxAssetNextCall("core") + local smoke = StartParticleFxLoopedOnEntityBone(smokeParticle, prop, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, GetEntityBoneIndexByName(prop, "ATTACH_POINT"), 0.05, false, false, false) + SetParticleFxLoopedAlpha(smoke, 0.3) + -- Progress bar for smoking QBCore.Functions.Progressbar("smoke_shisha", selectedShisha.label.." rauchen...", Config.SmokeTime or 30000, false, true, { disableMovement = false, @@ -199,6 +212,7 @@ function SmokeShisha(selectedShisha) -- Clean up animation and prop ClearPedTasks(ped) DeleteObject(prop) + StopParticleFxLooped(smoke, 0) -- Apply effects after smoking is complete TriggerEvent("evidence:client:SetStatus", "weedsmell", 300) @@ -208,9 +222,11 @@ function SmokeShisha(selectedShisha) -- Clean up if cancelled ClearPedTasks(ped) DeleteObject(prop) + StopParticleFxLooped(smoke, 0) end) end + -- Debug Event RegisterNetEvent('shisha-script:debug') AddEventHandler('shisha-script:debug', function(msg)