Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Fixed a bug that broke everything with the swap hook
  • Loading branch information
1OSaft authored Feb 6, 2024
1 parent eeab47f commit f1e975d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ This resource was created as a free script for backpacks using ox_inventory
- Customizable item name and storage parameters
- Compatibility for ESX

## Known bugs
- Only ESX compatible

## Installation

- Download this script
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ game 'gta5'
lua54 'yes'

description 'Wasabi Backpack for Ox Inventory'
version '1.0.6'
version '1.0.7'

client_scripts {
'client/**.lua'
Expand Down
6 changes: 4 additions & 2 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,25 @@ CreateThread(function()
local count_bagpacks = 0
local fromInv, toInv, move_type = payload.fromInventory, payload.toInventory, payload.toType

print(payload.fromSlot.name)
for vbag in pairs(Config.Backpacks) do
count_bagpacks = count_bagpacks + ox_inventory:GetItemCount(payload.source, vbag, nil, false)
end
if Config.Debug then
print("Count: " .. count_bagpacks)
print("Toinv: " .. toInv)
print("fromInv: "..fromInv)
print("Movetype: " .. move_type)
end

if string.find(toInv, 'bag') then
if string.find(toInv, 'bag') and string.find(payload.fromSlot.name, 'bag') then
TriggerClientEvent('ox_lib:notify', payload.source,
{ type = 'error', title = Strings.action_incomplete, description = Strings.backpack_in_backpack })
return false
end

if Config.OneBagInInventory then
if (move_type == "player" and count_bagpacks > 0 and toinv ~= fromInv) then
if (move_type == "player" and count_bagpacks > 0 and toinv ~= fromInv) and string.find(payload.fromSlot.name, 'bag') then
TriggerClientEvent('ox_lib:notify', payload.source,
{ type = 'error', title = Strings.action_incomplete, description = Strings.one_backpack_only })
return false
Expand Down

0 comments on commit f1e975d

Please sign in to comment.