require("lib.moonloader")
local font = renderCreateFont('Comic Sans MS', 10, 5)
function main()
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('hunter', function()
hunters = not hunters
sampAddChatMessage('[Hunter]{ffffff}'..(hunters and 'Активирован' or 'Деактивирован'), 0x00FA9A)
end)
while true do wait(0)
if hunters then
for k, v in ipairs(getAllChars()) do
local _, id = sampGetPlayerIdByCharHandle(v)
local res = sampIsPlayerNpc(id)
if res and isCharOnScreen( v ) then
local oX, oY, oZ = getCharCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
local skinid = getCharModel(v)
dist = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
renderDrawLine(x10, y10, x1, y1, 1.1, 0xFFDFF4500)
renderFontDrawText(font,"{FF4500}Цель\nРасстояние:"..dist, x1, y1, -1)
end
end
end
end
end