/qb-expandableVehicleTrunk

server-side expandable Vehicle Trunk

Primary LanguageLuaGNU General Public License v3.0GPL-3.0

Qb-expandableVehicleTrunk

  • Custom server-side vehicle inventory weight

Working on

  • add lock screen
  • mini-game

Installation

Step 1

  • install swkeep-tablet
  • and then import expandableVehicleTrunk.sql into your SQL

Step 2

  • inside "qb-inventory/client/main.lua".
  • try to find this code "if CurrentVehicle then -- Trunk".
  • and then you should be abale to see this line >> "local vehicleClass = GetVehicleClass(curVeh)"
  • then add code below
local plate = QBCore.Functions.GetPlate(curVeh)

Step 3

  • now try to find this code
local other = {
    maxweight = maxweight,
    slots = slots,
}
  • and then add "plate = plate" to table
local other = {
    maxweight = maxweight,
    slots = slots,
    plate = plate
}

Step 4

  • inside "qb-inventory/server/main.lua".
  • try to find this functions >> "inventory:server:OpenInventory".
if Trunks[id].isOpen then
    local Target = QBCore.Functions.GetPlayer(Trunks[id].isOpen)
    if Target ~= nil then
        TriggerClientEvent('inventory:client:CheckOpenState', Trunks[id].isOpen, name, id, Trunks[id].label)
    else
        Trunks[id].isOpen = false
    end
    end
end

    ( ADD CODE HERE )

secondInv.name = "trunk-"..id
secondInv.label = "Trunk-"..id
replace ( ADD CODE HERE ) with code below
    local result = exports.oxmysql:scalarSync('SELECT `actualCarryCapacity` FROM player_vehicles WHERE plate = ?',
        {other.plate})
    if result then
        other.maxweight = json.decode(result)
    end

Previews

tablet tablet tablet tablet tablet tablet tablet tablet