Помогите поставить активацию\деактивацию

Doner Kebab

Активный
Автор темы
453
61
Помогите плиз прошу это автооленина, на любую комманду.
 

Вложения

  • autoeat.lua
    217 байт · Просмотры: 11
Решение
Lua:
local ev = require 'lib.samp.events'
local enable = true

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand("aeat", function()
        enable = not enable
        sampAddChatMessage(enable and "Автоеда работает!" or "Автоеда не работает!")
    end)

    while true do
        wait(0)
    end
end

function ev.onDisplayGameText(style, time, text)
    if text:find("You are hungry!") or text:find("You are very hungry!") and enable then
    sampSendChat("/jmeat")
    return false
    end
end
Команда активации/деактивации: /aeat

После перезахода сохранятся НЕ будет

ARMOR

kjor32 is legend
Модератор
4,852
6,086
Lua:
local ev = require 'lib.samp.events'
local enable = true

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand("aeat", function()
        enable = not enable
        sampAddChatMessage(enable and "Автоеда работает!" or "Автоеда не работает!")
    end)

    while true do
        wait(0)
    end
end

function ev.onDisplayGameText(style, time, text)
    if text:find("You are hungry!") or text:find("You are very hungry!") and enable then
    sampSendChat("/jmeat")
    return false
    end
end
Команда активации/деактивации: /aeat

После перезахода сохранятся НЕ будет
 

Doner Kebab

Активный
Автор темы
453
61
Lua:
local ev = require 'lib.samp.events'
local enable = true

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end

    sampRegisterChatCommand("aeat", function()
        enable = not enable
        sampAddChatMessage(enable and "Автоеда работает!" or "Автоеда не работает!")
    end)

    while true do
        wait(0)
    end
end

function ev.onDisplayGameText(style, time, text)
    if text:find("You are hungry!") or text:find("You are very hungry!") and enable then
    sampSendChat("/jmeat")
    return false
    end
end
Команда активации/деактивации: /aeat

После перезахода сохранятся НЕ будет
Спасибо огрормное лучший! Сохранения и не нужен был <3