require 'lib.moonloader'
local Timer = {
font = renderCreateFont('Trebuchet MS', 30, 5),
state = false,
start = -1,
time = 8
}
function main()
while not isSampAvailable() do wait(0) end
while true do
wait(0)
if isGangWarGoingOn() then
if wasKeyPressed(VK_X) and not sampIsCursorActive() then
if getCharHealth(PLAYER_PED) < 150 then
sampSendChat('/usedrugs 3')
Timer.start, Timer.state = os.clock(), true
else
sampAddChatMessage('У вас уже больше 150 хп!', -1)
end
end
if Timer.state then
local resX, resY = getScreenResolution()
local TimeLeft = math.floor(Timer.start + Timer.time - os.clock())
renderFontDrawText(Timer.font, TimeLeft..' s.', resX / 2 - renderGetFontDrawTextLength(Timer.font, TimeLeft), resY / 3, 0xFFFFFFFF, 0x90000000)
if TimeLeft < 0 then
Timer.state = false
printStyledString('~r~USE!', 2000, 7)
end
end
end
end
end