Fixed problems with /clearloadout

This commit is contained in:
ElPumpo
2019-01-02 12:51:18 +01:00
parent 5e35663c95
commit 28d1ebe9d9
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -416,6 +416,11 @@ function CreateExtendedPlayer(player, accounts, inventory, job, loadout, name, l
if self.loadout[i].name == weaponName then
weaponLabel = self.loadout[i].label
for j=1, #self.loadout[i].components, 1 do
TriggerClientEvent('esx:removeWeaponComponent', self.source, weaponName, self.loadout[i].components[j])
table.remove(self.loadout[i].components, j)
end
table.remove(self.loadout, i)
break
end
+1 -1
View File
@@ -239,7 +239,7 @@ TriggerEvent('es:addGroupCommand', 'clearloadout', 'admin', function(source, arg
return
end
for i=1, #xPlayer.loadout, 1 do
for i=#xPlayer.loadout, 1, -1 do
xPlayer.removeWeapon(xPlayer.loadout[i].name)
end
end, function(source, args, user)