fix(clearinv): Player id definition

Fixes playerid from becoming "true" instead of the ID or source
This commit is contained in:
Joel
2022-04-23 21:35:09 +01:00
committed by GitHub
parent 45a09d667d
commit ad57a480b3
+1 -1
View File
@@ -208,7 +208,7 @@ end, 'admin')
-- Inventory (should be in qb-inventory?)
QBCore.Commands.Add('clearinv', 'Clear Players Inventory (Admin Only)', { { name = 'id', help = 'Player ID' } }, false, function(source, args)
local playerId = args[1] and args[1] ~= '' or source
local playerId = args[1] ~= '' and args[1] or source
local Player = QBCore.Functions.GetPlayer(tonumber(playerId))
if Player then
Player.Functions.ClearInventory()