require "lib.moonloader"
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('act', function() active = not active end)
while true do wait(0)
if active and wasKeyPressed(VK_H) then
for _, v in pairs(getAllChars()) do
local result, myid = sampGetPlayerIdByCharHandle(PLAYER_PED)
local mx, my, mz = getCharCoordinates(PLAYER_PED)
local x, y, z = getCharCoordinates(v)
local distance = getDistanceBetweenCoords3d(mx, my, mz, x, y, z)
local result, id = sampGetPlayerIdByCharHandle(v)
if result and id ~= myid and distance < 12.0 and isCharInAnyCar(v) and v == getDriverOfCar(storeCarCharIsInNoSave(v)) then
sampSendChat('/repare '..(tonumber(id)).." 1000")
wait(1200) --меняй под свою задержку в миллисекундах
end
end
end
end
end