local sf = require 'sampfuncs'
local script = {
dialogs = {
paragraph1 = false;
paragraph2 = true; -- +
paragraph3 = false;
paragraph4 = false;
paragraph5 = false;
paragraph6 = false;
paragraph7 = false; ----
paragraph8 = false;
paragraph9 = true; -- +
paragraph10 = true; -- +
paragraph11 = true; ---+
paragraph12 = set.Main.weather;
paragraph13 = true;
paragraph14 = set.RpSon.acase;
paragraph15 = set.RpSon.arecon;
paragraph16 = set.RpSon.aheal;
paragraph17 = set.RpSon.aeat;
paragraph18 = set.RpSon.noAFK;
paragraph19 = set.IgnorMessage.all;
paragraph20 = set.IgnorMessage.vip;
paragraph21 = set.IgnorMessage.ad;
paragraph22 = set.IgnorMessage.adm;
paragraph23 = set.IgnorMessage.smi
}
}
function menukey()
while true do
wait(40)
if not isSampfuncsConsoleActive() and not isPauseMenuActive() and not sampIsChatInputActive() and not sampIsDialogActive() then
if isKeyDown(93) then
while isKeyDown(93) do wait(80) end
lua_thread.create(dialog)
end
end
end
end
function dialog()
local status = {}
for v, k in pairs(script.dialogs) do
if k == true then
status[v] = '{32C13E}[Включен]'
elseif k == false then
status[v] = '{E21F1F}[Выключен]'
end
end
local dialogs = {
{
title = '{FF8C00}[1] {FFFFFF}РП сон',
onclick = function() lua_thread.create(noafksettings) end
},
{
title = '{FF8C00}[2] {FFFFFF}Отыгровки \t\t'..status['paragraph2'],
onclick = function(menu, row)
script.dialogs.paragraph2 = not script.dialogs.paragraph2
menu[row].title = '{FF8C00}[2] {FFFFFF}Отыгровки \t\t'..(script.dialogs.paragraph2 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[3] {FFFFFF}ВХ 1\t\t\t'..status['paragraph3'],
onclick = function(menu, row)
script.dialogs.paragraph3 = not script.dialogs.paragraph3
menu[row].title = '{FF8C00}[3] {FFFFFF}ВХ 1\t\t\t'..(script.dialogs.paragraph3 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[4] {FFFFFF}ВХ 2\t\t\t'..status['paragraph4'],
onclick = function(menu, row)
script.dialogs.paragraph4 = not script.dialogs.paragraph4
menu[row].title = '{FF8C00}[4] {FFFFFF}ВХ 2\t\t\t'..(script.dialogs.paragraph4 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[5] {FFFFFF}ВХ 3\t\t\t'..status['paragraph5'],
onclick = function(menu, row)
script.dialogs.paragraph5 = not script.dialogs.paragraph5
menu[row].title = '{FF8C00}[5] {FFFFFF}ВХ 3\t\t\t'..(script.dialogs.paragraph5 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[6] {FFFFFF}ВХ 4\t\t\t\t'..status['paragraph6'],
onclick = function(menu, row)
script.dialogs.paragraph6 = not script.dialogs.paragraph6
menu[row].title = '{FF8C00}[6] {FFFFFF}ВХ 4\t\t\t\t'..(script.dialogs.paragraph6 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[7] {FFFFFF}Автоответчик \t\t\t'..status['paragraph7'],
onclick = function(menu, row)
script.dialogs.paragraph7 = not script.dialogs.paragraph7
menu[row].title = '{FF8C00}[7] {FFFFFF}Автоответчик \t\t\t'..(script.dialogs.paragraph7 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[8] {FFFFFF}Авто сбив \t\t\t\t'..status['paragraph8'],
onclick = function(menu, row)
script.dialogs.paragraph8 = not script.dialogs.paragraph8
menu[row].title = '{FF8C00}[8] {FFFFFF}Авто сбив \t\t\t\t'..(script.dialogs.paragraph8 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[9] {FFFFFF}Автологин \t\t\t\t'..status['paragraph9'],
onclick = function(menu, row)
script.dialogs.paragraph9 = not script.dialogs.paragraph9
menu[row].title = '{FF8C00}[9] {FFFFFF}Автологин \t\t\t\t'..(script.dialogs.paragraph9 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[10] {FFFFFF}Таймеры\t\t'..status['paragraph10'],
onclick = function(menu, row)
script.dialogs.paragraph10 = not script.dialogs.paragraph10
menu[row].title = '{FF8C00}[10] {FFFFFF}Таймеры\t\t'..(script.dialogs.paragraph10 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[11] {FFFFFF}Авто ввод PIN-кода \t\t'..status['paragraph11'],
onclick = function(menu, row)
script.dialogs.paragraph11 = not script.dialogs.paragraph11
menu[row].title = '{FF8C00}[11] {FFFFFF}Авто ввод PIN-кода \t\t'..(script.dialogs.paragraph11 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[12] {FFFFFF}Автовзлом \t'..status['paragraph13'],
onclick = function(menu, row)
script.dialogs.paragraph13 = not script.dialogs.paragraph13
menu[row].title = '{FF8C00}[12] {FFFFFF}Автовзлом\t'..(script.dialogs.paragraph13 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
return true
end
},
{
title = '{FF8C00}[13] {FFFFFF}Игнор сообщений',
onclick = function() lua_thread.create(ignormessage) end
},
{
title = '{FF8C00}[14] {FFFFFF}Варианты',
onclick = function() lua_thread.create(clicktype) end
},
{
title = '{FF8C00}[15] {FFFFFF}Настройки',
onclick = function() lua_thread.create(skriptpose) end
}
}
submenus_show(dialogs, "А шо це таке?", "Выбрать", "Закрыть")
end
function noafksettings()
local status = {}
for v, k in pairs(script.dialogs) do
if k == true then
status[v] = '{32C13E}[Включен]'
elseif k == false then
status[v] = '{E21F1F}[Выключен]'
end
end
local dialogs = {
{
title = '{FF8C00}[1] {FFFFFF}Статус скрипта \t\t\t'..status['paragraph1'],
onclick = function(menu, row)
script.dialogs.paragraph1 = not script.dialogs.paragraph1
menu[row].title = '{FF8C00}[1] {FFFFFF}Статус скрипта \t\t\t'..(script.dialogs.paragraph1 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
if script.dialogs.paragraph18 and script.dialogs.paragraph1 then
writeMemory(7634870, 1, 1, 1)
writeMemory(7635034, 1, 1, 1)
mem.fill(7623723, 144, 8)
mem.fill(5499528, 144, 6)
else
writeMemory(7634870, 1, 0, 1)
writeMemory(7635034, 1, 0, 1)
mem.hex2bin('5051FF1500838500', 7623723, 8)
mem.hex2bin('0F847B010000', 5499528, 6)
end
return true
end
},
{
title = '{FF8C00}[2] {FFFFFF}Авто кейс с рулетками \t\t'..status['paragraph14'],
onclick = function(menu, row)
script.dialogs.paragraph14 = not script.dialogs.paragraph14
menu[row].title = '{FF8C00}[2] {FFFFFF}Авто кейс с рулетками \t\t'..(script.dialogs.paragraph14 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
set.RpSon.acase = not set.RpSon.acase
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[3] {FFFFFF}Авто перезаход \t\t\t'..status['paragraph15'],
onclick = function(menu, row)
script.dialogs.paragraph15 = not script.dialogs.paragraph15
menu[row].title = '{FF8C00}[3] {FFFFFF}Авто перезаход \t\t\t'..(script.dialogs.paragraph15 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
set.RpSon.arecon = not set.RpSon.arecon
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[4] {FFFFFF}Авто хилл \t\t\t\t'..status['paragraph16'],
onclick = function(menu, row)
script.dialogs.paragraph16 = not script.dialogs.paragraph16
menu[row].title = '{FF8C00}[4] {FFFFFF}Авто хилл \t\t\t\t'..(script.dialogs.paragraph16 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
set.RpSon.aheal = not set.RpSon.aheal
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[5] {FFFFFF}Авто сытость \t\t\t'..status['paragraph17'],
onclick = function(menu, row)
script.dialogs.paragraph17 = not script.dialogs.paragraph17
menu[row].title = '{FF8C00}[5] {FFFFFF}Авто сытость \t\t\t'..(script.dialogs.paragraph17 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
set.RpSon.aeat = not set.RpSon.aeat
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[6] {FFFFFF}Анти АФК \t\t\t\t'..status['paragraph18'],
onclick = function(menu, row)
script.dialogs.paragraph18 = not script.dialogs.paragraph18
menu[row].title = '{FF8C00}[6] {FFFFFF}Анти АФК \t\t\t\t'..(script.dialogs.paragraph18 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
set.RpSon.noAFK = not set.RpSon.noAFK
inicfg.save(set, "settings")
return true
end
},
}
submenus_show(dialogs, "А шо це таке?", "Выбрать", "Закрыть")
end
function skriptpose()
local status = {}
for v, k in pairs(script.dialogs) do
if k == true then
status[v] = '{32C13E}[Включен]'
elseif k == false then
status[v] = '{E21F1F}[Выключен]'
end
end
local dialogs = {
{
title = '{FF8C00}[1] {FFFFFF}Настройка 1',
onclick = function()
wait(400)
showCursor(true, true)
pos5 = true
script.dialogs.paragraph3 = true
end
},
{
title = '{FF8C00}[2] {FFFFFF}Настройка 2',
onclick = function()
wait(400)
showCursor(true, true)
pos4 = true
script.dialogs.paragraph4 = true
end
},
{
title = '{FF8C00}[3] {FFFFFF}Настройка 3',
onclick = function()
wait(400)
showCursor(true, true)
pos2 = true
script.dialogs.paragraph5 = true
end
},
{
title = '{FF8C00}[4] {FFFFFF}Настройка 4',
onclick = function()
wait(400)
showCursor(true, true)
pos3 = true
script.dialogs.paragraph6 = true
end
}
}
submenus_show(dialogs, "А шо це таке?", "Выбрать", "Закрыть")
end
function ignormessage()
local status = {}
for v, k in pairs(script.dialogs) do
if k == true then
status[v] = '{32C13E}[Включен]'
elseif k == false then
status[v] = '{E21F1F}[Выключен]'
end
end
local dialogs = {
{
title = '{FF8C00}[1] {FFFFFF}Выбрать всё\t\t\t\t',
onclick = function(menu, row)
script.dialogs.paragraph19 = not script.dialogs.paragraph19
if not script.dialogs.paragraph19 then
set.IgnorMessage.vip,script.dialogs.paragraph20 = false,false
set.IgnorMessage.ad, script.dialogs.paragraph21 = false,false
set.IgnorMessage.adm, script.dialogs.paragraph22 = false,false
set.IgnorMessage.smi, script.dialogs.paragraph23 = false,false
else
set.IgnorMessage.vip, script.dialogs.paragraph20 = true,true
set.IgnorMessage.ad, script.dialogs.paragraph21 = true,true
set.IgnorMessage.adm, script.dialogs.paragraph22 = true,true
set.IgnorMessage.smi, script.dialogs.paragraph23 = true,true
end
inicfg.save(set, "settings")
end
},
{
title = '{FF8C00}[2] {FFFFFF}Вип чат\t\t\t\t'..status['paragraph20'],
onclick = function(menu, row)
script.dialogs.paragraph20 = not script.dialogs.paragraph20
menu[row].title = '{FF8C00}[2] {FFFFFF}Вип чат\t\t\t\t'..(script.dialogs.paragraph20 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
if not script.dialogs.paragraph20 then
set.IgnorMessage.vip = false
else
set.IgnorMessage.vip = true
end
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[3] {FFFFFF}Объявления\t\t\t'..status['paragraph21'],
onclick = function(menu, row)
script.dialogs.paragraph21 = not script.dialogs.paragraph21
menu[row].title = '{FF8C00}[3] {FFFFFF}Объявления\t\t\t'..(script.dialogs.paragraph21 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
if not script.dialogs.paragraph21 then
set.IgnorMessage.ad = false
else
set.IgnorMessage.ad = true
end
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[4] {FFFFFF}Действия админов\t\t\t'..status['paragraph22'],
onclick = function(menu, row)
script.dialogs.paragraph22 = not script.dialogs.paragraph22
menu[row].title = '{FF8C00}[4] {FFFFFF}Действия админов\t\t\t'..(script.dialogs.paragraph22 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
if not script.dialogs.paragraph22 then
set.IgnorMessage.adm = false
else
set.IgnorMessage.adm = true
end
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[5] {FFFFFF}Сообщения СМИ\t\t\t'..status['paragraph23'],
onclick = function(menu, row)
script.dialogs.paragraph23 = not script.dialogs.paragraph23
menu[row].title = '{FF8C00}[5] {FFFFFF}Вип объявления\t\t\t'..(script.dialogs.paragraph23 and '{32C13E}[Включен]' or '{E21F1F}[Выключен]')
if not script.dialogs.paragraph23 then
set.IgnorMessage.smi = false
else
set.IgnorMessage.smi = true
end
inicfg.save(set, "settings")
return true
end
}
}
submenus_show(dialogs, "А шо це таке?", "Выбрать", "Закрыть")
end
function clicktype()
local dialogs = {
{
title = '{FF8C00}[1] {FFFFFF}Первый вариант',
onclick = function(menu, row)
menu[row].title = '{FF8C00}[1] {FFFFFF}Первый вариант'
set.Main.clicktype = 1
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[2] {FFFFFF}Второй вариант',
onclick = function(menu, row)
menu[row].title = '{FF8C00}[2] {FFFFFF}Второй вариант'
set.Main.clicktype = 2
inicfg.save(set, "settings")
return true
end
},
{
title = '{FF8C00}[3] {FFFFFF}Третий вариант',
onclick = function(menu, row)
menu[row].title = '{FF8C00}[3] {FFFFFF}Третий вариант'
set.Main.clicktype = 3
inicfg.save(set, "settings")
return true
end
}
}
submenus_show(dialogs, "А шо це таке?", "Выбрать", "Закрыть")
end
function submenus_show(menu, caption, select_button, close_button, back_button)
select_button, close_button, back_button = select_button or 'Select', close_button or 'Close', back_button or 'Back'
prev_menus = {}
function display(menu, id, caption)
local string_list = {}
for i, v in ipairs(menu) do
table.insert(string_list, type(v.submenu) == 'table' and v.title .. ' >>' or v.title)
end
sampShowDialog(id, caption, table.concat(string_list, '\n'), select_button, (#prev_menus > 0) and back_button or close_button, sf.DIALOG_STYLE_LIST)
repeat
wait(0)
local result, button, list = sampHasDialogRespond(id)
if result then
if button == 1 and list ~= -1 then
local item = menu[list + 1]
if type(item.submenu) == 'table' then -- submenu
table.insert(prev_menus, {menu = menu, caption = caption})
if type(item.onclick) == 'function' then
item.onclick(menu, list + 1, item.submenu)
end
return display(item.submenu, id + 1, item.submenu.title and item.submenu.title or item.title)
elseif type(item.onclick) == 'function' then
local result = item.onclick(menu, list + 1)
if not result then return result end
return display(menu, id, caption)
end
else -- if button == 0
if #prev_menus > 0 then
local prev_menu = prev_menus[#prev_menus]
prev_menus[#prev_menus] = nil
return display(prev_menu.menu, id - 1, prev_menu.caption)
end
return false
end
end
until result
end
return display(menu, 31337, caption or menu.title)
end