forked from Simnation/Main
Update client.lua
This commit is contained in:
parent
ba5689c242
commit
dc8db27d8f
1 changed files with 21 additions and 5 deletions
|
@ -163,13 +163,15 @@ end
|
||||||
function SmokeShisha(selectedShisha)
|
function SmokeShisha(selectedShisha)
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
local propName = "v_corp_lngestoolfd" -- Dieses Modell wird von irgendwo auf dem Server geladen
|
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)
|
-- Angepasste Position und Rotation für bessere Platzierung
|
||||||
local propRotation = vector3(0.0, 0.0, 0.0)
|
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"
|
-- Bessere Rauch-Animation
|
||||||
local animName = "idle_c"
|
local animDict = "timetable@gardener@smoking_joint"
|
||||||
|
local animName = "smoke_idle"
|
||||||
|
|
||||||
-- Request model and animation
|
-- Request model and animation
|
||||||
RequestModel(GetHashKey(propName))
|
RequestModel(GetHashKey(propName))
|
||||||
|
@ -189,6 +191,17 @@ function SmokeShisha(selectedShisha)
|
||||||
-- Play animation
|
-- Play animation
|
||||||
TaskPlayAnim(ped, animDict, animName, 8.0, -8.0, -1, 49, 0, false, false, false)
|
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
|
-- Progress bar for smoking
|
||||||
QBCore.Functions.Progressbar("smoke_shisha", selectedShisha.label.." rauchen...", Config.SmokeTime or 30000, false, true, {
|
QBCore.Functions.Progressbar("smoke_shisha", selectedShisha.label.." rauchen...", Config.SmokeTime or 30000, false, true, {
|
||||||
disableMovement = false,
|
disableMovement = false,
|
||||||
|
@ -199,6 +212,7 @@ function SmokeShisha(selectedShisha)
|
||||||
-- Clean up animation and prop
|
-- Clean up animation and prop
|
||||||
ClearPedTasks(ped)
|
ClearPedTasks(ped)
|
||||||
DeleteObject(prop)
|
DeleteObject(prop)
|
||||||
|
StopParticleFxLooped(smoke, 0)
|
||||||
|
|
||||||
-- Apply effects after smoking is complete
|
-- Apply effects after smoking is complete
|
||||||
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
|
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
|
||||||
|
@ -208,9 +222,11 @@ function SmokeShisha(selectedShisha)
|
||||||
-- Clean up if cancelled
|
-- Clean up if cancelled
|
||||||
ClearPedTasks(ped)
|
ClearPedTasks(ped)
|
||||||
DeleteObject(prop)
|
DeleteObject(prop)
|
||||||
|
StopParticleFxLooped(smoke, 0)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Debug Event
|
-- Debug Event
|
||||||
RegisterNetEvent('shisha-script:debug')
|
RegisterNetEvent('shisha-script:debug')
|
||||||
AddEventHandler('shisha-script:debug', function(msg)
|
AddEventHandler('shisha-script:debug', function(msg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue