diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index a9c2fa54..d02757e0 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -121,17 +121,17 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end function self.getAccounts(minimal) - if minimal then - local minimalAccounts = {} - - for i=1, #self.accounts do - minimalAccounts[self.accounts[i].name] = self.accounts[i].money - end - - return minimalAccounts - else + if not minimal then return self.accounts end + + local minimalAccounts = {} + + for i=1, #self.accounts do + minimalAccounts[self.accounts[i].name] = self.accounts[i].money + end + + return minimalAccounts end function self.getAccount(account) @@ -163,32 +163,31 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, end function self.getLoadout(minimal) - if minimal then - local minimalLoadout = {} - - for k,v in ipairs(self.loadout) do - minimalLoadout[v.name] = {ammo = v.ammo} - if v.tintIndex > 0 then minimalLoadout[v.name].tintIndex = v.tintIndex end - - if #v.components > 0 then - local components = {} - - for k2,component in ipairs(v.components) do - if component ~= 'clip_default' then - components[#components + 1] = component - end - end - - if #components > 0 then - minimalLoadout[v.name].components = components - end - end - end - - return minimalLoadout - else + if not minimal then return self.loadout end + local minimalLoadout = {} + + for k,v in ipairs(self.loadout) do + minimalLoadout[v.name] = {ammo = v.ammo} + if v.tintIndex > 0 then minimalLoadout[v.name].tintIndex = v.tintIndex end + + if #v.components > 0 then + local components = {} + + for k2,component in ipairs(v.components) do + if component ~= 'clip_default' then + components[#components + 1] = component + end + end + + if #components > 0 then + minimalLoadout[v.name].components = components + end + end + end + + return minimalLoadout end function self.getName()