|
|
|
@ -482,6 +482,63 @@ menu.update = function() |
|
|
|
|
menu.show = { true, "get_guns" } |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
{ -->> Разделитель |
|
|
|
|
title = " \t ", |
|
|
|
|
click = function(button, list, input , outs) |
|
|
|
|
if button ~= 1 then return end |
|
|
|
|
menu.show = { true, "main" } |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
{ -->> Mafiawar |
|
|
|
|
title = "{"..config.data.font.color1.."}".."Автоматический mafiawar\t", |
|
|
|
|
click = function(button, list, input , outs) |
|
|
|
|
if button ~= 1 then return end |
|
|
|
|
menu.show = { true, "main" } |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
{ -->> Mafiawar auto |
|
|
|
|
title = "{"..config.data.font.color1.."}"..">{ffffff} Флудер\t"..(config.data.mafiawar.auto and "вкл" or "выкл"), |
|
|
|
|
click = function(button, list, input , outs) |
|
|
|
|
if button ~= 1 then return end |
|
|
|
|
config.data.mafiawar.auto = not config.data.mafiawar.auto |
|
|
|
|
config.save(config.data) |
|
|
|
|
menu.show = { true, "main" } |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
{ -->> Mafiawar id |
|
|
|
|
title = "{"..config.data.font.color1.."}"..">{ffffff} ID\t"..config.data.mafiawar.id, |
|
|
|
|
click = function(button, list, input , outs) |
|
|
|
|
if button ~= 1 then return end |
|
|
|
|
menu.show = { true, "edit", function(button, list, input, outs) |
|
|
|
|
if button == 1 then |
|
|
|
|
if input:find("(%d+)") then |
|
|
|
|
local id = tonumber(input:match("(%d+)")) |
|
|
|
|
if id >= 0 and id <= 4 then |
|
|
|
|
config.data.mafiawar.id = id |
|
|
|
|
config.save(config.data) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
menu.show = { true, "main" } |
|
|
|
|
end, config.data.mafiawar.id, "Введите ID для стрелы [0-4]"} |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
{ -->> Mafiawar wait |
|
|
|
|
title = "{"..config.data.font.color1.."}"..">{ffffff} Задержка флудера\t"..config.data.mafiawar.wait.." ms", |
|
|
|
|
click = function(button, list, input , outs) |
|
|
|
|
if button ~= 1 then return end |
|
|
|
|
menu.show = { true, "edit", function(button, list, input, outs) |
|
|
|
|
if button == 1 then |
|
|
|
|
if input:find("(%d+)") then |
|
|
|
|
local wait = tonumber(input:match("(%d+)")) |
|
|
|
|
config.data.mafiawar.wait = wait |
|
|
|
|
config.save(config.data) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
menu.show = { true, "main" } |
|
|
|
|
end, config.data.mafiawar.wait, "Введите задержку для флудера mafiawar в ms"} |
|
|
|
|
end |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
["edit"] = { |
|
|
|
@ -662,6 +719,18 @@ mafiawar.id = -1 |
|
|
|
|
mafiawar.biz = false |
|
|
|
|
mafiawar.time = 0 |
|
|
|
|
mafiawar.onServerMessage = function(color, message) |
|
|
|
|
if message:find("^ Начать войну можно не раньше (%d+):00$") then |
|
|
|
|
local hour = message:match("^ Начать войну можно не раньше (%d+):00$") |
|
|
|
|
datetime = { |
|
|
|
|
year = tonumber(os.date("%Y")), |
|
|
|
|
month = tonumber(os.date("%m")), |
|
|
|
|
day = tonumber(os.date("%d")), |
|
|
|
|
hour = tonumber(hour), |
|
|
|
|
min = 0, |
|
|
|
|
sec = 0 |
|
|
|
|
} |
|
|
|
|
mafiawar.time = os.time(datetime) |
|
|
|
|
end |
|
|
|
|
if message:find("^ Начать войну с этой мафией можно не раньше (%d+):00$") then |
|
|
|
|
local hour = message:match("^ Начать войну с этой мафией можно не раньше (%d+):00$") |
|
|
|
|
datetime = { |
|
|
|
@ -684,7 +753,8 @@ mafiawar.onServerMessage = function(color, message) |
|
|
|
|
if message:find("^ Война за бизнес %{6AB1FF%}.+ %{FFFFFF%}пройдет в %{6AB1FF%}.+ %{FFFFFF%}| ID: {6AB1FF}%d+$") or |
|
|
|
|
message == " Ваша мафия уже участвует в войне" or |
|
|
|
|
message == " Эта мафия уже начала войну за бизнес" or |
|
|
|
|
message == " Этот бизнес под контролем вашей мафии" then |
|
|
|
|
message == " Этот бизнес под контролем вашей мафии" or |
|
|
|
|
message:find("^ Начать войну за этот бизнес можно не раньше %d+:%d+$") then |
|
|
|
|
if mafiawar.biz then |
|
|
|
|
mafiawar.biz = false |
|
|
|
|
mafiawar.time = 0 |
|
|
|
@ -713,7 +783,7 @@ mafiawar.loop = function() |
|
|
|
|
antiflood.send[#antiflood.send+1] = "/mafiawar "..config.data.mafiawar.id |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
if mafiawar.time ~= 0 and os.time() < mafiawar.time then |
|
|
|
|
if mafiawar.time ~= 0 and os.time() > mafiawar.time then |
|
|
|
|
if antiflood.get() > config.data.mafiawar.wait then |
|
|
|
|
sampSendChat("/mafiawar "..config.data.mafiawar.id) |
|
|
|
|
end |
|
|
|
|