Steal Systems

Welcome to Steal System

If you use qb-core, it does not require changes, since the same event will be used as in the native qb-inventory, therefore this step is purely informative.

Quasar Inventory has an exclusive event for caching systems or searching other players inventories, therefore we must follow this modification to enable thefts in your factions.

The code that you see below must be executed:

TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", GetPlayerServerId(closestPlayer))

I will leave you a small example of how this event will be executed, please read it patiently and execute it on the asset you want:

RegisterNetEvent('event:search')
AddEventHandler('event:search', function(closestPlayer)
    local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
    if closestPlayer ~= -1 and closestDistance <= 3.0 then
        TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", GetPlayerServerId(closestPlayer))
    end
end)

Last updated