tweak(ESX): Added RemoveAnimDict after TaskPlayAnim

This commit is contained in:
badfantomasss
2022-06-05 21:17:41 +02:00
parent 089f2e1c4f
commit 12487a07e2
8 changed files with 12 additions and 0 deletions
+2
View File
@@ -1051,6 +1051,7 @@ function ESX.ShowInventory()
if type == 'item_weapon' then
menu1.close()
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
RemoveAnimDict(dict)
Wait(1000)
TriggerServerEvent('esx:removeInventoryItem', type, item)
else
@@ -1063,6 +1064,7 @@ function ESX.ShowInventory()
menu2.close()
menu1.close()
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
RemoveAnimDict(dict)
Wait(1000)
TriggerServerEvent('esx:removeInventoryItem', type, item, quantity)
else
+1
View File
@@ -485,6 +485,7 @@ if not Config.OxInventory then
local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor'
ESX.Streaming.RequestAnimDict(dict)
TaskPlayAnim(ESX.PlayerData.ped, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
RemoveAnimDict(dict)
Wait(1000)
TriggerServerEvent('esx:onPickup', pickupId)
+1
View File
@@ -3,6 +3,7 @@ local function Progressbar(message,length,Options)
if Options.animation.type == "anim" then
ESX.Streaming.RequestAnimDict(Options.animation.dict, function()
TaskPlayAnim(ESX.PlayerData.ped, Options.animation.dict, Options.animation.lib, 1.0, 1.0, length, 1, 1.0, false,false,false)
RemoveAnimDict(Options.animation.dict)
end)
end
end
@@ -153,6 +153,7 @@ function revivePlayer(closestPlayer)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0.0, false, false, false)
RemoveAnimDict(lib)
end)
end
@@ -115,6 +115,7 @@ AddEventHandler('esx_ambulancejob:useItem', function(itemName)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
RemoveAnimDict(lib)
Wait(500)
while IsEntityPlayingAnim(playerPed, lib, anim, 3) do
@@ -132,6 +133,7 @@ AddEventHandler('esx_ambulancejob:useItem', function(itemName)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0, false, false, false)
RemoveAnimDict(lib)
Wait(500)
while IsEntityPlayingAnim(playerPed, lib, anim, 3) do
@@ -9,6 +9,7 @@ end
function startAnim(lib, anim)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(PlayerPedId(), lib, anim, 8.0, -8.0, -1, 0, 0.0, false, false, false)
RemoveAnimDict(lib)
end)
end
@@ -89,6 +89,7 @@ AddEventHandler('esx_basicneeds:onEat', function(prop_name)
ESX.Streaming.RequestAnimDict('mp_player_inteat@burger', function()
TaskPlayAnim(playerPed, 'mp_player_inteat@burger', 'mp_player_int_eat_burger_fp', 8.0, -8, -1, 49, 0, 0, 0, 0)
RemoveAnimDict('mp_player_inteat@burger')
Wait(3000)
IsAnimated = false
@@ -115,6 +116,7 @@ AddEventHandler('esx_basicneeds:onDrink', function(prop_name)
ESX.Streaming.RequestAnimDict('mp_player_intdrink', function()
TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 2000, 0, 1, true, true, true)
RemoveAnimDict('mp_player_intdrink')
Wait(3000)
IsAnimated = false
@@ -1040,6 +1040,7 @@ AddEventHandler('esx_policejob:handcuff', function()
end
TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
RemoveAnimDict('mp_arresting')
SetEnableHandcuffs(playerPed, true)
DisablePlayerFiring(playerPed, true)
@@ -1215,6 +1216,7 @@ CreateThread(function()
if IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) ~= 1 then
ESX.Streaming.RequestAnimDict('mp_arresting', function()
TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0.0, false, false, false)
RemoveAnimDict('mp_arresting')
end)
end
else