require("moonloader")
damages = {}
function main()
while not isSampAvailable() do
wait(0)
end
while true do
wait(0)
MYPOS = {
getCharCoordinates(PLAYER_PED)
}
local slot0_a1059, slot1_a1061 = getScreenResolution()
for slot5_a1047, slot6_a1057 in ipairs(damages) do
if os.clock() - slot6_a1057.clock > 2 and slot6_a1057.fadeClock == 0 then
slot6_a1057.fadeClock = os.clock()
end
if slot6_a1057.fadeClock ~= 0 and os.clock() - slot6_a1057.fadeClock >= 2 then
table.remove(damages, slot5_a1047)
else
slot6_a1057.fade = 2 - (os.clock() - slot6_a1057.fadeClock)
local slot12_a1064 = "0x%xb31010"
renderFigure2D(slot6_a1057.heading, slot0_a1059 / 2, slot1_a1061 / 2, 100, slot12_a1064:format(slot6_a1057.fade * 127.5), false)
end
end
end
end
function renderFigure2D(arg0_a1126, arg1_a1100, arg2_a1108, arg3_a1098, arg4_a1148, arg5_a1139)
local slot6_a1112 = math.pi * 2 / 360
local slot7_a1141 = {}
local slot8_a1144 = {}
local slot9_a1091 = -1
for slot13_a1095 = -1.57, math.pi * 2, slot6_a1112 do
local slot9_a1092 = slot9_a1091 + 1
slot7_a1141[1] = arg3_a1098 * math.cos(slot13_a1095) + arg1_a1100
slot7_a1141[2] = arg3_a1098 * math.sin(slot13_a1095) + arg2_a1108
slot8_a1144[1] = arg3_a1098 * math.cos(slot13_a1095 + slot6_a1112) + arg1_a1100
slot8_a1144[2] = arg3_a1098 * math.sin(slot13_a1095 + slot6_a1112) + arg2_a1108
if slot9_a1092 == math.floor(arg0_a1126) then
renderDrawPolygon(slot7_a1141[1], slot7_a1141[2], 15, 15, 15, 0, arg4_a1148)
end
if arg5_a1139 then
renderDrawLine(slot7_a1141[1], slot7_a1141[2], slot8_a1144[1], slot8_a1144[2], 1, arg4_a1148)
end
end
end
function returnAngle()
local slot0_a1152, slot1_a1153, slot2_a1154 = getActiveCameraCoordinates()
local slot3_a1156, slot4_a1157, slot5_a1158 = getActiveCameraPointAt()
return getHeadingFromVector2d(slot3_a1156 - slot0_a1152, slot4_a1157 - slot1_a1153)
end
function getXYHeading(arg0_a1163, arg1_a1164)
local slot2_a1182 = math.rad(getHeadingFromVector2d(arg0_a1163 - MYPOS[1], arg1_a1164 - MYPOS[2]) + math.abs(returnAngle() - 360))
return getHeadingFromVector2d(math.deg(math.sin(slot2_a1182)), math.deg(math.cos(slot2_a1182)))
end
function onSendRpc(arg0_a1196, arg1_a1199)
if arg0_a1196 == 115 then
local slot2_a1201 = raknetBitStreamReadBool(arg1_a1199)
local slot3_a1206 = raknetBitStreamReadInt16(arg1_a1199)
if slot2_a1201 then
local slot4_a1208, slot5_a1215 = sampGetCharHandleBySampPlayerId(slot3_a1206)
if slot4_a1208 and doesCharExist(slot5_a1215) then
local slot6_a1217, slot7_a1218, slot8_a1219 = getCharCoordinates(slot5_a1215)
table.insert(damages, {
fade = 2,
fadeClock = 0,
clock = os.clock(),
heading = getXYHeading(slot6_a1217, slot7_a1218)
})
end
end
end
end