mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
Fixed problems with /clearloadout
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user