mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
fix(client): Fix restoring of loadout
This commit is contained in:
+3
-4
@@ -71,10 +71,7 @@ AddEventHandler('playerSpawned', function()
|
||||
end
|
||||
|
||||
-- Restore loadout
|
||||
for i=1, #ESX.PlayerData.loadout, 1 do
|
||||
local weaponHash = GetHashKey(ESX.PlayerData.loadout[i].name)
|
||||
GiveWeaponToPed(playerPed, weaponHash, ESX.PlayerData.loadout[i].ammo, false, false)
|
||||
end
|
||||
TriggerEvent('esx:restoreLoadout')
|
||||
|
||||
PlayerSpawned = true
|
||||
|
||||
@@ -94,6 +91,8 @@ AddEventHandler('esx:restoreLoadout', function ()
|
||||
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
|
||||
RemoveAllPedWeapons(playerPed, true)
|
||||
|
||||
for i=1, #ESX.PlayerData.loadout, 1 do
|
||||
local weaponHash = GetHashKey(ESX.PlayerData.loadout[i].name)
|
||||
GiveWeaponToPed(playerPed, weaponHash, ESX.PlayerData.loadout[i].ammo, false, false)
|
||||
|
||||
Reference in New Issue
Block a user