Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: param mismatches and cache.resource #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/carry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -127,4 +127,4 @@ AddStateBagChangeHandler('instance', ('player:%s'):format(cache.serverId), funct
weaponModule.refreshProps(Inventory, currentWeapon)
end
end
end)
end)
4 changes: 2 additions & 2 deletions modules/vehicles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -97,4 +97,4 @@ end)

return {
addVehicleStateBag = addVehicleStateBag
}
}
4 changes: 2 additions & 2 deletions modules/weapons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -179,4 +179,4 @@ return {
updateWeapons = updateState,
loopFlashlight = flashLightLoop,
refreshProps = refreshProps,
}
}