I’m looking for a way to disable certain inventory slots from being robbable. More specifically, cops pockets. I’d like to protect the on duty cops from being pocket wiped, and at least retaining their duty gear in the event of death.
I assume this would be easiest if handled in qb-inventory, but if there is another solution then I’m all ears!
Here is what I’m trying to test:
elseif name == "otherplayer" then
local OtherPlayer = QBCore.Functions.GetPlayer(tonumber(id))
if OtherPlayer then
secondInv.name = "otherplayer-"..id
secondInv.label = "Player-"..id
secondInv.maxweight = QBCore.Config.Player.MaxWeight
secondInv.inventory = OtherPlayer.PlayerData.items
if Player.PlayerData.job.name == "police" and Player.PlayerData.job.onduty then
secondInv.slots = QBCore.Config.Player.MaxInvSlots
elseif OtherPlayer.PlayerData.job.name == "police" and OtherPlayer.PlayerData.job.onduty then
secondInv.slots = 6, QBCore.Config.Player.MaxInvSlots - 1
else
secondInv.slots = QBCore.Config.Player.MaxInvSlots - 1
end
Wait(250)
end