المود الثاني الي انت اعطيته ياه
ما ينزل غير السلاح الي كان بيده قبل ما يموت
اما لو يبي ينزل كل اسلحته
function getPedWeapons(ped) -- to Mr.Tlal07
local playerWeapons = {}
if ped and isElement(ped) and getElementType(ped) == 'ped' or getElementType(ped) == 'player' then
for i=1,12 do
local wep = getPedWeapon(ped,i)
if wep and wep ~= 0 then
table.insert(playerWeapons,wep)
end
end
else
return false
end
return playerWeapons
end
addEventHandler("onPlayerWasted",root,
function( )
for i,v in ipairs(getPedWeapons(source)) do
local x,y,z = getElementPosition(source)
local totalammo = getPedTotalAmmo(source,getSlotFromWeapon(v))
pickupweap = createPickup ( x+math.random(0.5,1.6), y+math.random(0.5,1.6), z, 2, v, 0, totalammo )
takeWeapon(source,v,totalammo, true)
end
end
)
addEventHandler("onPickupHit",resourceRoot,
function( player )
local ammo = getPickupAmmo ( source )
local weapon = getPickupWeapon ( source )
giveWeapon(player, weapon, ammo, true)
destroyElement(source)
end)
سويتلك ياه علسريع جرب وعطني خبر