Events

Information regarding boii_base server inventory events

sync_drop_entry

0Event used to sync drop inventories across clients

RegisterServerEvent('boii_base:sv:sync_drop_entry', function(drop_id, drop_entry)
    if drop_id and drop_entry then
        drop_inventories[drop_id] = drop_entry
        TriggerClientEvent('boii_base:cl:update_drop_inventories', -1, drop_inventories)
    end
end)

update_inventory

Event used to update the players inventory and sync other inventory types. This will be expanded on as additional inventory types are added and additional options for owned vehicles.

RegisterServerEvent('boii_base:sv:update_inventory', function(type, inventory)
    if type == nil then
        local _src = source
        local player = boii.get_user(_src)
        if not player then print('player not found') return end
        print('player found')
        player.inventory = inventory
        player:set_data({'inventory'})
    end
    if type == 'glovebox' then
        glovebox_inventories = inventory
        TriggerClientEvent('boii_base:cl:sync_other_inventories', -1, 'glovebox', inventory)
    elseif type == 'trunk' then
        trunk_inventories = inventory
        TriggerClientEvent('boii_base:cl:sync_other_inventories', -1, 'trunk', inventory)
    end
end)

Last updated