function playerWasted()
local skin = getPlayerSkin(source)
local x, y, z = getElementPosition(source)
local r = getPedRotation(source)
local table_Weapon = {}
for i = 0, 12 do
if getPedWeapon(source, i) ~= 0 then
table_Weapon[i]["ID"] = getPedWeapon(source, i)
table_Weapon[i]["Ammo"] = getPedTotalAmmo(source, i)
end
end
spawn(player, skin, x, y, z, r, table_Weapon)
end
addEventHandler("onPlayerWasted", getRootElement(), playerWasted) function spawn(player, skin, x, y, z, r, table_Weapon)
for i = 0, 12 do
if table_Weapon[i] then
giveWeapon(player,table_Weapon[i]["ID"],table_Weapon[i]["Ammo"])
end
end
spawnPlayer(player, x, y, z, r, skin)
end