From b93539556e3286fbbe387b6f8c124b1424a2c25c Mon Sep 17 00:00:00 2001 From: rubin Date: Fri, 10 Feb 2023 23:49:01 +0300 Subject: [PATCH] added message warelock & added server request warelock --- mafia-tools.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index 986db63..5032ec3 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -600,6 +600,16 @@ menu.update = function() end, config.data.mhcars.offset_wait, "Введите на сколько секунд раньше нужно начать флудить"} end }, + { -->> Запрос открыть склад + title = "{"..config.data.font.color1.."}"..">{ffffff} Запрос открыть склад", + click = function(button, list, input , outs) + if button ~= 1 then return end + request.warelock = true + request.wait = 0 + menu.show = { true, "main" } + + end + }, } }, ["edit"] = { @@ -1087,7 +1097,7 @@ get_guns.loop = function() end table.remove(get_guns.messages, 1) end - if #get_guns.warelock_send > 0 then + if #get_guns.warelock_send > 0 and antiflood.get() > 700 then if get_guns.warelock_send[1][1] < os.time() then if get_guns.warelock_send[1][2] == get_guns.warehouse then antiflood.send[#antiflood.send+1] = "/warelock" @@ -1320,7 +1330,7 @@ request.loop = function() room = config.data.room, send = request.send, can_warelock = can_warelock, - request_warelock = request.warelock + request_warelock = request.warelock, rand = os.clock() } request.send = {} @@ -1390,6 +1400,19 @@ request.handler = function(text) end end end + + --> warelock + if info["response_warelock"] ~= nil and info["response_warelock"] ~= "" then + addChatMessage(info["response_warelock"]) + end + --> can_warelock + if info["can_warelock"] ~= nil and info["can_warelock"] then + get_guns.warelock_send = { + { os.time(), false }, + { os.time() + config.data.get_guns.warelock_time, true } + } + end + end return true end