local sampev = require 'lib.samp.events'
state = true
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('ahl', ah) -- активация/деактивация.
while true do wait(0)
local myhp = getCharHealth(PLAYER_PED)
if state then
if myhp < 25 then
sampSendChat('/usedrugs ') -- ставишь своё кол-во.
state = false
end
end
end
end
function sampev.onServerMessage(color, text)
if text:find('^Здоровье пополнено до.*') then -- ставь свой текст, если тот имеется, чтобы после usedrugs оно работало дальше.
state = true
end
end
function ah()
state = not state
printStringNow(state and '~g~ON' or '~r~OFF', 500)
end