mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
Merge pull request #1822 from seltonmt012/fix/loadout-unknown-weapon
fix(es_extended/server/main): skip unknown weapons when loading a loadout
This commit is contained in:
@@ -289,9 +289,9 @@ function loadESXPlayer(identifier, playerId, isNew)
|
|||||||
|
|
||||||
local loadout = json.decode(result.loadout)
|
local loadout = json.decode(result.loadout)
|
||||||
for name, weapon in pairs(loadout) do
|
for name, weapon in pairs(loadout) do
|
||||||
local label = ESX.GetWeaponLabel(name)
|
local found, label = pcall(ESX.GetWeaponLabel, name)
|
||||||
|
|
||||||
if label then
|
if found and label then
|
||||||
userData.loadout[#userData.loadout + 1] = {
|
userData.loadout[#userData.loadout + 1] = {
|
||||||
name = name,
|
name = name,
|
||||||
ammo = weapon.ammo,
|
ammo = weapon.ammo,
|
||||||
|
|||||||
Reference in New Issue
Block a user