Skip to content

Commit effb02c

Browse files
committed
Inventory Update
1 parent 2a2ed24 commit effb02c

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

client/main.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,14 +1006,8 @@ local function openHouseStash()
10061006
if not CurrentHouse then return end
10071007
local stashLoc = vector3(stashLocation.x, stashLocation.y, stashLocation.z)
10081008
if CheckDistance(stashLoc, 1.5) then
1009-
local houseTier = tonumber(Config.Houses[CurrentHouse].tier)
1010-
if Config.StashWeights[houseTier] and tonumber(Config.StashWeights[houseTier].maxweight) and tonumber(Config.StashWeights[houseTier].slots) then
1011-
TriggerServerEvent('inventory:server:OpenInventory', 'stash', CurrentHouse, Config.StashWeights[houseTier])
1012-
else
1013-
TriggerServerEvent('inventory:server:OpenInventory', 'stash', CurrentHouse)
1014-
end
1015-
TriggerEvent('inventory:client:SetCurrentStash', CurrentHouse)
10161009
TriggerServerEvent('InteractSound_SV:PlayOnSource', 'StashOpen', 0.4)
1010+
TriggerServerEvent('qb-houses:server:openStash', CurrentHouse)
10171011
end
10181012
end
10191013

@@ -1386,7 +1380,6 @@ RegisterNetEvent('qb-houses:client:HomeInvasion', function()
13861380
if dist < 1 then
13871381
if Config.Houses[ClosestHouse].locked then
13881382
if not Config.Houses[ClosestHouse].IsRaming then
1389-
13901383
local success = exports['qb-minigames']:Skillbar('medium') -- calling like this will just change difficulty and still use 1234
13911384
if success then
13921385
DoRamAnimation(true)

server/main.lua

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,29 @@ end)
210210
RegisterNetEvent('qb-houses:server:viewHouse', function(house)
211211
local src = source
212212
local pData = QBCore.Functions.GetPlayer(src)
213-
214213
local houseprice = Config.Houses[house].price
215214
local brokerfee = (houseprice / 100 * 5)
216215
local bankfee = (houseprice / 100 * 10)
217216
local taxes = (houseprice / 100 * 6)
217+
TriggerClientEvent('qb-houses:client:viewHouse', src, houseprice, brokerfee, bankfee, taxes, pData.PlayerData.charinfo.firstname, pData.PlayerData.charinfo.lastname)
218+
end)
218219

219-
TriggerClientEvent('qb-houses:client:viewHouse', src, houseprice, brokerfee, bankfee, taxes,
220-
pData.PlayerData.charinfo.firstname, pData.PlayerData.charinfo.lastname)
220+
RegisterNetEvent('qb-houses:server:openStash', function(CurrentHouse)
221+
local src = source
222+
local houseData = Config.Houses[CurrentHouse]
223+
if not houseData then return end
224+
local houseTier = houseData.tier
225+
local stashSlots = Config.StashWeights[houseTier].slots
226+
local stashWeight = Config.StashWeights[houseTier].maxweight
227+
if stashSlots and stashWeight then
228+
exports['qb-inventory']:OpenInventory(src, CurrentHouse, {
229+
maxweight = stashWeight,
230+
slots = stashSlots,
231+
label = houseData.adress
232+
})
233+
else
234+
exports['qb-inventory']:OpenInventory(src, CurrentHouse)
235+
end
221236
end)
222237

223238
RegisterNetEvent('qb-houses:server:buyHouse', function(house)

0 commit comments

Comments
 (0)