Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Fixed an error
  • Loading branch information
1OSaft authored Feb 6, 2024
1 parent f1e975d commit dda17e3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
34 changes: 18 additions & 16 deletions client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ local timeout, changed, puttedon = false, false, false

local function PutOnBag(bagtype)
bagtype = bagtype
if Config.Debug then print("Putting on Backpack") end
if Config.Debug then print("Bag type: " .. bagtype) end
if Config.Framework == 'ESX' then
TriggerEvent('skinchanger:getSkin', function(skin)
if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, Config.Backpacks[bagtype].Uniform.Male)
else
TriggerEvent('skinchanger:loadClothes', skin, Config.Backpacks[bagtype].Uniform.Female)
end
saveSkin()
end)
elseif Config.Framework == 'ND' then
local appearance = fivemAppearance:getPedAppearance(cache.ped)
if bagtype ~= nil then
if Config.Debug then print("Putting on Backpack") end
if Config.Debug then print("Bag type: " .. bagtype) end
if Config.Framework == 'ESX' then
TriggerEvent('skinchanger:getSkin', function(skin)
if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, Config.Backpacks[bagtype].Uniform.Male)
else
TriggerEvent('skinchanger:loadClothes', skin, Config.Backpacks[bagtype].Uniform.Female)
end
saveSkin()
end)
elseif Config.Framework == 'ND' then
local appearance = fivemAppearance:getPedAppearance(cache.ped)
end
bagEquipped, CurrentBag = true, bagtype
end
bagEquipped, CurrentBag = true, bagtype
end

saveSkin = function()
Expand Down Expand Up @@ -55,7 +57,7 @@ function tableChange(data)
for vbag in pairs(Config.Backpacks) do
count = ox_inventory:Search('count', vbag)
if count > 0 then
if count >= 1 and bagEquipped == nil then
if count >= 1 then
PutOnBag(vbag)
if Config.Debug then
print("Count: " .. count)
Expand All @@ -72,7 +74,7 @@ function boolChange()
count = count + ox_inventory:Search('count', vbag)
end

if count > 0 and bagEquipped == true then
if count > 0 then
if count >= 1 then
PutOnBag(vbag)
if Config.Debug then
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.7'
version '1.0.8'

client_scripts {
'client/**.lua'
Expand Down
8 changes: 5 additions & 3 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ CreateThread(function()
end

if Config.OneBagInInventory 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,
if (move_type == "player" and count_bagpacks > 0 and string.find(payload.fromSlot.name, 'bag')) then
if fromInv ~= toInv then
TriggerClientEvent('ox_lib:notify', payload.source,
{ type = 'error', title = Strings.action_incomplete, description = Strings.one_backpack_only })
return false
return false
end
end
end
return true
Expand Down

0 comments on commit dda17e3

Please sign in to comment.