qbcore-framework / qb-smallresources

A compilation of small resources combined into one
GNU General Public License v3.0
51 stars 346 forks source link

[BUG] qb-smallresources\client\consumables.lua #374

Closed theghostglitch closed 9 months ago

theghostglitch commented 1 year ago

consumables:client:UseJoint in consumables.lua does not work for females. There needs to be a check here for gender. The emote smokeweed is male only. The emote for females is smokeweed2. This also causes the script to fail and mental status does not go down.

To Reproduce Use a joint from inventory as a female character.

Expected behavior The smokeweed animation should play and mental should go down.

Questions (please complete the following information):

theghostglitch commented 1 year ago

I did a little re-code to fix the issue, if you want to use/work around it.

RegisterNetEvent('consumables:client:UseJoint', function() local gender = QBCore.Functions.GetPlayerData().charinfo.gender QBCore.Functions.Progressbar("smoke_joint", Lang:t('consumables.joint_progress'), 1500, false, true, { disableMovement = false, disableCarMovement = false, disableMouse = false, disableCombat = true, }, {}, {}, {}, function() -- Done TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items["joint"], "remove") if IsPedInAnyVehicle(PlayerPedId(), false) then TriggerEvent('animations:client:EmoteCommandStart', {"smoke3"}) elseif gender == 1 then TriggerEvent('animations:client:EmoteCommandStart', {"smokeweed2"}) else TriggerEvent('animations:client:EmoteCommandStart', {"smokeweed"}) end TriggerEvent("evidence:client:SetStatus", "weedsmell", 300) TriggerServerEvent('hud:server:RelieveStress', math.random(20, 50)) end) end)

AnishBplayz commented 1 year ago

@theghostglitch create a PR if you haven't yet with the fix

github-actions[bot] commented 10 months ago

This issue has had 60 days of inactivity & will close within 7 days