act = false
function main()
repeat
wait(0)
until isSampAvailable()
sampAddChatMessage('{0000FF}[AUTOHEAL] /AHEAL', -1)
sampRegisterChatCommand("aheal",function() act = not act printStringNow(act and "~b~[AUTOHEAL]: ~g~ON" or "~b~[AUTOHEAL]: ~r~OFF", 1000) end)
while true do wait(0)
local health = getCharHealth(PLAYER_PED)
if health <= 10025 and act then -- желаемое количество хп
local id = select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))
sampSendChat("/heal "..id)
end
end
end