Skip to content

Commit

Permalink
refactor(client): don't send plate to server when opening vehicle inv
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Nov 9, 2024
1 parent 70abcfd commit f14934c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ local function registerCommands()
-- No storage or no glovebox
if (checkVehicle == 0 or checkVehicle == 2) or (not Vehicles.glovebox[vehicleClass] and not Vehicles.glovebox.models[vehicleHash]) then return end

local isOpen = client.openInventory('glovebox', { id = 'glove'..GetVehicleNumberPlateText(vehicle), netid = NetworkGetNetworkIdFromEntity(vehicle) })
local isOpen = client.openInventory('glovebox', { netid = NetworkGetNetworkIdFromEntity(vehicle) })

if isOpen then
currentInventory.entity = vehicle
Expand Down Expand Up @@ -1186,6 +1186,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
---@class PlayerData
---@field inventory table<number, SlotWithItem?>
---@field weight number
---@field groups table<string, number>
PlayerData = player
PlayerData.id = cache.playerId
PlayerData.source = cache.serverId
Expand Down
4 changes: 1 addition & 3 deletions modules/inventory/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ function Inventory.OpenTrunk(entity)

if not door then return end

local plate = GetVehicleNumberPlateText(entity)
local invId = 'trunk'..plate
local coords = GetEntityCoords(entity)

TaskTurnPedToFaceCoord(cache.ped, coords.x, coords.y, coords.z, 0)

if not client.openInventory('trunk', { id = invId, netid = NetworkGetNetworkIdFromEntity(entity), entityid = entity, door = door }) then return end
if not client.openInventory('trunk', { netid = NetworkGetNetworkIdFromEntity(entity), entityid = entity, door = door }) then return end

if type(door) == 'table' then
for i = 1, #door do
Expand Down

0 comments on commit f14934c

Please sign in to comment.