qb-core
qb-core copied to clipboard
[BUG] Smoking joint - No stress relief - No animation played
Summary
[BUG] Smoking joint - No stress relief - No animation played
Reproduction
Smoke a joint - No stress relief - No animation played
Expected behavior
Smoke a joint - stress relief - animation played
Actual behavior
Smoke a joint - No stress relief - No animation played
Additional context
nil
Last Updated
a few days ago
Custom Resources
nil
Resource Rename
false
Hey, I changed some lines in the original code. The animation isn't the best, but you can try other props and animations. If you have any questions, send me a message on discord. User: hatelyzz
RegisterNetEvent('consumables:client:UseJoint', function()
TriggerEvent('animations:client:EmoteCommandStart', {"joint"})
QBCore.Functions.Progressbar("smoke_joint", "Apertando um..", 2600, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {
animDict = "amb@world_human_smoking@male@male_a@enter",
anim = "enter",
flags = 49,
}, {
model = 'p_cs_joint_02',
bone = 47419,
coords = vec3(0.015, -0.009, 0.003),
rotation = vec3(55.0, 0.0, 110.0),
}, {}, function()
TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["joint"], "remove")
TriggerEvent('animations:client:EmoteCommandStart', {"c"})
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
TriggerServerEvent('hud:server:RelieveStress', math.random(10, 15))
end)
end)
@gab3mioni
very good
RegisterNetEvent('consumables:client:UseJoint', function()
TriggerEvent('animations:client:EmoteCommandStart', {"SmokeWeed"})
QBCore.Functions.Progressbar("smoke_joint", "420..", 15000, false, true, {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
}, {
animDict = "amb@world_human_smoking@male@male_a@enter",
anim = "enter",
flags = 49,
}, {
model = 'p_cs_joint_02',
bone = 47419,
coords = vec3(0.015, -0.009, 0.003),
rotation = vec3(55.0, 0.0, 110.0),
}, {}, function()
TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["joint"], "remove")
TriggerEvent('animations:client:EmoteCommandStart', {"c"})
TriggerEvent("evidence:client:SetStatus", "weedsmell", 300)
TriggerServerEvent('hud:server:RelieveStress', math.random(25, 50))
end)
end)
I think there may be code in there not needed but im just a noob.
https://github.com/qbcore-framework/qb-smallresources/compare/d06d5c104552...71fd3eac5f12
thanks @GhzGarage