function getPedWeapons(ped)
local playerWeapons = {}
if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then
for i=2,9 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
function SaberArmas (player)
qtdArmas = 0
for i,wep in ipairs(getPedWeapons(player)) do
qtdArmas = i
end
if qtdArmas > 0 then
outputChatBox("Você tem: " ..qtdArmas.. " armas")
else
outputChatBox("Você não tem nenhum armamento!")
end
end
addEventHandler("onMarkerHit", MarkerInfo, SaberArmas)
Tente isso, meu jovem.