39 lines
1.1 KiB
Lua
39 lines
1.1 KiB
Lua
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 |