script_name('HPUSE')
script_author('sat0ry')
require('moonloader')
function main()
while not(isSampAvailable()) do
wait(100)
end
sampRegisterChatCommand('hpuse', function()
timer = timer and nil or 0
printString(timer and 'HPUSE: Activated' or 'HPUSE: Deactvated', 650)
end)
while true do
wait(0)
local health = getCharHealth(PLAYER_PED)
if ((timer or os.time() + 5) < os.time()) then
if (health <= 25) then
sampSendChat('/usedrugs 1')
timer = os.time() + 10
end
end
end
end