local sampev = require("samp.events")
local font = renderCreateFont("Arial", 10, 13)
function sampev.onSendBulletSync(data)
last_x, last_y, last_z = data.target.x, data.target.y, data.target.z
end
function sampev.onSendGiveDamage(id, damage, weapon, bodypart)
lua_thread.create(function()
local start = os.clock()
local weapon = getCurrentCharWeapon(PLAYER_PED)
if damage and weapon >= 22 and weapon <= 34 then
local x, y, z = last_x, last_y, last_z
while os.clock() - start < 2 do wait(0)
if not hasDeatharrestBeenExecuted(id) then
local sx, sy = convert3DCoordsToScreen(x, y, z)
renderFontDrawText(font, damage, sx, sy, 0xFFFFFFFF)
else
renderFontDrawText(font, damage, sx, sy, 0xFFFF0000)
end
end
end
end)
end