Fixes player being stuck when consuming

This commit is contained in:
taylorrenee1
2023-02-24 11:01:05 -08:00
committed by GitHub
parent e7d9946532
commit 0b42cbc362

View File

@@ -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)