mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 04:01:24 +00:00
Fix(RemoveItem): Exploit Remove Item
This issues fixes the possible exploit when removing an item when sending the item slot parameter before you were able to send any amount of an item and it would return as if the remove item worked just fine returning true
This commit is contained in:
+1
-1
@@ -366,7 +366,7 @@ function QBCore.Player.CreatePlayer(PlayerData)
|
||||
self.Functions.UpdatePlayerData()
|
||||
TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(self.PlayerData.source) .. ' (citizenid: ' .. self.PlayerData.citizenid .. ' | id: ' .. self.PlayerData.source .. ')** lost item: [slot:' .. slot .. '], itemname: ' .. self.PlayerData.items[slot].name .. ', removed amount: ' .. amount .. ', new total amount: ' .. self.PlayerData.items[slot].amount)
|
||||
return true
|
||||
else
|
||||
elseif self.PlayerData.items[slot].amount == amount then
|
||||
self.PlayerData.items[slot] = nil
|
||||
self.Functions.UpdatePlayerData()
|
||||
TriggerEvent('qb-log:server:CreateLog', 'playerinventory', 'RemoveItem', 'red', '**' .. GetPlayerName(self.PlayerData.source) .. ' (citizenid: ' .. self.PlayerData.citizenid .. ' | id: ' .. self.PlayerData.source .. ')** lost item: [slot:' .. slot .. '], itemname: ' .. item .. ', removed amount: ' .. amount .. ', item removed')
|
||||
|
||||
Reference in New Issue
Block a user