addEventHandler("onPlayerQuit", root,
function()
local account = getPlayerAccount(source)
if account and not isGuestAccount(account) then
for slot = 1, 12 do
setAccountData(account, "WeaponID"..slot, getPedWeapon(source, slot))
setAccountData(account, "Ammo"..slot, getPedTotalAmmo(source, slot))
end
end
end);
addEventHandler("onPlayerLogin", root,
function(_, account)
for slot = 1, 12 do
local wep = getAccountData(account, "WeaponID"..slot)
local ammo = getAccountData(account, "Ammo"..slot)
if wep and ammo then
giveWeapon(source, wep, ammo)
end
end
end);