Skip to content

Commit

Permalink
Fix trunk items for policejob (#422)
Browse files Browse the repository at this point in the history
* inventory: fix adding trunk items for client side

* Bump

---------

Co-authored-by: Zerio <[email protected]>
Co-authored-by: zwkf <[email protected]>
  • Loading branch information
3 people authored Feb 25, 2023
1 parent 099980d commit 56b45d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'cerulean'
game 'gta5'

description 'QB-Inventory'
version '1.2.3'
version '1.2.4'

shared_scripts {
'@qb-core/shared/locale.lua',
Expand All @@ -15,6 +15,7 @@ server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/main.lua'
}

client_script 'client/main.lua'

ui_page {
Expand Down
16 changes: 11 additions & 5 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1339,15 +1339,19 @@ AddEventHandler('onResourceStart', function(resourceName)
end)
end
end)

RegisterNetEvent('QBCore:Server:UpdateObject', function()
if source ~= '' then return end -- Safety check if the event was not called from the server.
QBCore = exports['qb-core']:GetCoreObject()
end)

function addTrunkItems(plate, items)
Trunks[plate] = {}
Trunks[plate].items = items
end
exports('addTrunkItems',addTrunkItems)

exports('addTrunkItems', addTrunkItems)

function addGloveboxItems(plate, items)
Gloveboxes[plate] = {}
Gloveboxes[plate].items = items
Expand Down Expand Up @@ -2262,11 +2266,13 @@ RegisterNetEvent('inventory:server:snowball', function(action)
RemoveItem(source, "weapon_snowball")
end
end)
RegisterNetEvent('inventory:server:addTrunkItems', function()
print('inventory:server:addTrunkItems has been deprecated please use exports[\'qb-inventory\']:addTrunkItems(plate, items)')

RegisterNetEvent('inventory:server:addTrunkItems', function(plate, items)
addTrunkItems(plate, items)
end)
RegisterNetEvent('inventory:server:addGloveboxItems', function()
print('inventory:server:addGloveboxItems has been deprecated please use exports[\'qb-inventory\']:addGloveboxItems(plate, items)')

RegisterNetEvent('inventory:server:addGloveboxItems', function(plate, items)
addGloveboxItems(plate, items)
end)
--#endregion Events

Expand Down

0 comments on commit 56b45d1

Please sign in to comment.