require 'lib.moonloader'
status = false
function main()
while not isSampLoaded() do wait(100) end
local font = renderCreateFont(Arial, 10, 13)
sampRegisterChatCommand("courier", function()
status = not status
sampAddChatMessage("{42aaff}Поиск курьера: {FF0000}"..(status and "ВКЛ" or "ВЫКЛ"), 0xFFFF0000)
end)
while true do wait(0)
if status then
for k, v in ipairs(getAllChars()) do
local result, id = sampGetPlayerIdByCharHandle(v)
if not result and v ~= playerPed and getCharModel(v) == 181 and isCharOnScreen(v) then
local my_pos = {convert3DCoordsToScreen(getCharCoordinates(playerPed))}
local position = {convert3DCoordsToScreen(getCharCoordinates(v))}
local distance = string.format("%.1f", getDistanceBetweenCoords3d(my_pos, position))
renderFontDrawText(font, "{FB4343}Бот! {FFFFFF}Дистанция: "..distance, my_pos[1], my_pos[2], -1)
renderDrawLine(my_pos[1], my_pos[2], position[1], position[2], 2, -1)
end
end
end
end
end