mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-02 19:28:52 +00:00
fix(server/commands): /clearloadout will properly wipe all weapons
Loadout indexes are being updated while the loop runs causing it to break after removing a few weapons. This reverts the command to how it worked prior to ESX 1.2
This commit is contained in:
+2
-2
@@ -117,8 +117,8 @@ end, true, {help = _U('command_clearinventory'), validate = true, arguments = {
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('clearloadout', 'admin', function(xPlayer, args, showError)
|
||||
for k,v in ipairs(args.playerId.loadout) do
|
||||
args.playerId.removeWeapon(v.name)
|
||||
for i=#args.playerId.loadout, 1, -1 do
|
||||
xPlayer.removeWeapon(args.playerId.loadout[i].name)
|
||||
end
|
||||
end, true, {help = _U('command_clearloadout'), validate = true, arguments = {
|
||||
{name = 'playerId', help = _U('commandgeneric_playerid'), type = 'player'}
|
||||
|
||||
Reference in New Issue
Block a user