From 0b42cbc3623d9270e5b68c3ce871e3262c30930d Mon Sep 17 00:00:00 2001 From: taylorrenee1 <120302939+taylorrenee1@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:01:05 -0800 Subject: [PATCH 1/2] Fixes player being stuck when consuming --- client/client.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/client/client.lua b/client/client.lua index de7e078..3e617f3 100644 --- a/client/client.lua +++ b/client/client.lua @@ -68,15 +68,17 @@ RegisterNetEvent('jim-consumables:Consume', function(itemName) end --Emote Stuff if Config.Debug then print("^5Debug^7: ^3Consume^7: ^2Grabbing Emote Animation Options^7...") end - if emote.AnimationOptions then - if emote.AnimationOptions.EmoteLoop then MovementType = 1 - elseif emote.AnimationOptions.EmoteMoving then MovementType = 51 - elseif emote.AnimationOptions.EmoteMoving == false then MovementType = 0 - elseif emote.AnimationOptions.EmoteStuck then MovementType = 50 end - else MovementType = 0 end + local InVehicle = IsPedInAnyVehicle(Player, true) + if Config.Debug then print("^5Debug^7: ^3Consume^7: ^Player is in a vehicle^7..."..json.encode(InVehicle).." ") end if Config.Debug then print("^5Debug^7: ^3Consume^7: ^2Checking if player is in a vehicle^7...") end - local InVehicle = IsPedInAnyVehicle(Player, true) - if InVehicle == 1 then MovementType = 51 end + if InVehicle == 1 then MovementType = 51 + elseif emote.AnimationOptions then + if emote.AnimationOptions.EmoteMoving then MovementType = 51 + elseif emote.AnimationOptions.EmoteLoop then MovementType = 1 + elseif emote.AnimationOptions.EmoteStuck then MovementType = 50 + elseif emote.AnimationOptions.EmoteMoving == false then MovementType = 0 + end + end --Load and Start animation if Config.Debug then print("^5Debug^7: ^3Consume^7: ^2Playing Animation^7...") end loadAnimDict(animDict) From 429bf50b3aa6cd2ca03e4e59c5294113f3096c72 Mon Sep 17 00:00:00 2001 From: taylorrenee1 <120302939+taylorrenee1@users.noreply.github.com> Date: Fri, 24 Feb 2023 11:04:47 -0800 Subject: [PATCH 2/2] also adds print to check movement type --- client/client.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.lua b/client/client.lua index 3e617f3..b11868f 100644 --- a/client/client.lua +++ b/client/client.lua @@ -83,7 +83,7 @@ RegisterNetEvent('jim-consumables:Consume', function(itemName) if Config.Debug then print("^5Debug^7: ^3Consume^7: ^2Playing Animation^7...") end loadAnimDict(animDict) TaskPlayAnim(Player, animDict, anim, 1.0, 1.0, -1, MovementType, 0, 0, 0, 0) - + if Config.Debug then print("^5Debug^7: ^3Consume^7: ^Player Movement Type is^7..."..json.encode(MovementType).." ") end if Config.UseProgbar then QBCore.Functions.Progressbar('jimmy_consume_', string..QBCore.Shared.Items[itemName].label.."..", time, false, false, {disableMovement = false, disableCarMovement = false, disableMouse = false, disableCombat = true,}, {}, {}, {}, function() consuming = false end, function() end, itemName) else