- 396
- 130
- Версия SA-MP
-
- Любая
- Другая
Lua:
local smoke = false
local drugs = false
local name1 = "[AutoHeal]" -- Тег AutoSmoke
local name2 = "[AutoDrugs]" -- Тег AutoDrugs
local yellow = "{ff8c00}" -- Желтый цвет
local white = "{ffffff}" -- Белый цвет
local tag1 = yellow .. name1 .. white
local tag2 = yellow .. name2 .. white
function main()
while not isSampAvailable() do wait(100) end
sampAddChatMessage(tag1 .. " Успешно загружен! Активация: /autosmoke // /autodrugs", -1)
sampRegisterChatCommand('autosmoke', asmoke)
sampRegisterChatCommand('autodrugs', adrugs)
end
function asmoke()
smoke = not smoke
if smoke then
sampAddChatMessage(tag1 .. " Включен!", -1)
printStringNow('AutoSmoke ~g~ON', 3000)
while true do
wait(0)
local health = getCharHealth(PLAYER_PED)
if health < 25 then
wait(1500)
sampSendChat("/smoke")
end
end
else
sampAddChatMessage(tag1 .. " Выключен!", -1)
printStringNow('AutoSmoke ~r~OFF', 3000)
end
end
function adrugs()
adrugs = not adrugs
if adrugs then
sampAddChatMessage(tag2 .. " Включен!", -1)
printStringNow('AutoDrugs ~g~ON', 3000)
while true do
wait(0)
local health = getCharHealth(PLAYER_PED)
if health < 25 then
wait(1500)
sampSendChat("/usedrugs 3")
end
end
else
sampAddChatMessage(tag2 .. " Выключен!", -1)
printStringNow('AutoDrugs ~r~OFF', 3000)
end
end