diff --git a/modules/carry.lua b/modules/carry.lua index a17cc47..16c8daa 100644 --- a/modules/carry.lua +++ b/modules/carry.lua @@ -110,7 +110,7 @@ local function carryLoop(itemConfig) while carryingItem do if dict and not overideanim and not IsEntityPlayingAnim(cache.ped, dict, anim, 3) then - TaskPlayAnim(cache.ped, dict, anim, 8.0, -8, -1, flag, 0, 0, 0, 0) + TaskPlayAnim(cache.ped, dict, anim, 8.0, -8, -1, flag, 0, false, false, false) end if amount > 0 then @@ -135,6 +135,7 @@ local function carryLoop(itemConfig) end end +---@diagnostic disable-next-line: param-type-mismatch AddStateBagChangeHandler('carry_items', nil, function(bagName, keyName, value, _, replicated) if replicated then return @@ -204,7 +205,7 @@ local function updateState(inventory) end AddEventHandler('onResourceStop', function(resource) - if resource == GetCurrentResourceName() then + if resource == cache.resource then for k, _ in pairs(Players) do removePlayer(k) end diff --git a/modules/inventory.lua b/modules/inventory.lua index 069ea73..a626989 100644 --- a/modules/inventory.lua +++ b/modules/inventory.lua @@ -47,7 +47,7 @@ AddEventHandler('ox_inventory:updateInventory', function(changes) end) AddEventHandler('onResourceStart', function(resource) - if resource == GetCurrentResourceName() then + if resource == cache.resource then Wait(100) if table.type(playerState.weapons_carry or {}) ~= 'empty' then playerState:set('weapons_carry', false, true) @@ -127,4 +127,4 @@ AddStateBagChangeHandler('instance', ('player:%s'):format(cache.serverId), funct weaponModule.refreshProps(Inventory, currentWeapon) end end -end) \ No newline at end of file +end) diff --git a/modules/vehicles.lua b/modules/vehicles.lua index 618c76c..f884170 100644 --- a/modules/vehicles.lua +++ b/modules/vehicles.lua @@ -81,7 +81,7 @@ local function addVehicleStateBag(name) end AddEventHandler('onResourceStop', function(resource) - if resource == GetCurrentResourceName() then + if resource == cache.resource then for bagname, _ in pairs(Vehicles) do if Vehicles[bagname] and table.type(Vehicles[bagname]) ~= 'empty' then @@ -97,4 +97,4 @@ end) return { addVehicleStateBag = addVehicleStateBag -} \ No newline at end of file +} diff --git a/modules/weapons.lua b/modules/weapons.lua index 0241e93..b5b562e 100644 --- a/modules/weapons.lua +++ b/modules/weapons.lua @@ -125,7 +125,7 @@ local function updateState(inventory, currentWeapon) end AddEventHandler('onResourceStop', function(resource) - if resource == GetCurrentResourceName() then + if resource == cache.resource then for _, v in pairs(Players) do if v then Utils.removeEntities(v) @@ -179,4 +179,4 @@ return { updateWeapons = updateState, loopFlashlight = flashLightLoop, refreshProps = refreshProps, -} \ No newline at end of file +}