diff --git a/NoAngle.lua b/NoAngle.lua new file mode 100644 index 0000000..dd31ff5 --- /dev/null +++ b/NoAngle.lua @@ -0,0 +1,39 @@ +script_name("NoAngle") +script_author("treywisp") + +local memory = require("memory") +local inicfg = require("inicfg") + +local settings_source = "NoAngle.ini" +local settings = inicfg.load({ + main = { + active = true + } +}, settings_source) + +local function notify(text) + sampAddChatMessage("[NoAngle] {FFFFFF}" .. text, 0xDC143C) +end + +local function setState() + local byte = settings.main.active and 0xEB or 0x75 + memory.fill(0x5E4DA1, byte, 1, true) + memory.fill(0x5E4DF6, byte, 1, true) +end + +function main() + while not isSampAvailable() do wait(100) end + + setState() + notify("Скрипт загружен и сейчас " .. (settings.main.active and "{00FF00}включен{FFFFFF}. " or "{FF0000}выключен{FFFFFF}. ") .. + "Команда " .. (settings.main.active and "деактивации" or "активации") .. ": /noa") + + sampRegisterChatCommand("noa", function() + settings.main.active = not settings.main.active + setState() + inicfg.save(settings, settings_source) + notify(settings.main.active and "Скрипт теперь включен" or "Скрипт выключен") + end) + + wait(-1) +end \ No newline at end of file