From ca838ad87a5e1daa71d9e3da4d2925cf67ddebdc Mon Sep 17 00:00:00 2001 From: rubin Date: Sat, 11 Feb 2023 18:32:31 +0300 Subject: [PATCH] delete old warehouse request on chat & final update new server request warehouse --- mafia-tools.lua | 62 ++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index 5032ec3..1a80201 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -600,16 +600,6 @@ 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"] = { @@ -969,14 +959,11 @@ get_guns.onServerMessage = function(color, message) if message:find("^ %d+/%d+ Матов | %d+/%d+ Аптечек") and os.time() - get_guns.check_warehouse_time < 2 then return false end - if message:find("^ .+%[%d+%]: (.+)") and color == 33357823 then - get_guns.messages[#get_guns.messages+1] = message:match("^ .+%[%d+%]: (.+)") - end if message:find("^ .+ открыл%(а%) склад с оружием$") then get_guns.warehouse = true if not message:find(getLocalPlayerNickname()) then get_guns.warelock_send = {} - if config.data.get_guns.auto_get_guns and get_guns.enter_textdraw then + if config.data.get_guns.auto_get_guns and get_guns.enter_textdraw and isPlayerInWarehouse() then get_guns.start_get() end end @@ -1069,34 +1056,19 @@ get_guns.loop = function() end end if isPlayerInMafia() then - if get_guns.enter_textdraw and isKeyCanBePressed() and isKeysPressed(config.data.get_guns.key) and not get_guns.getgun then - get_guns.start_get() + if get_guns.enter_textdraw and isPlayerInWarehouse() and isKeyCanBePressed() and isKeysPressed(config.data.get_guns.key) and not get_guns.getgun then + if not get_guns.warehouse and config.data.stats.rank < 8 then + request.warelock = true + request.wait = 0 + msg.add("Отправлен запрос") + else + get_guns.start_get() + end else if isKeysPressed(config.data.get_guns.key) and get_guns.getgun then msg.add("Выполняется взятие ганов") end end - if #get_guns.messages > 0 then - if config.data.get_guns.warelock_auto and not get_guns.warehouse and config.data.stats.rank >= 8 then - local result = false - local text = split(get_guns.messages[1], " ") - for i = 1, #config.data.get_guns.warelock_text do - for p = 1, #text do - if text[p] == config.data.get_guns.warelock_text[i] then - result = true - end - end - end - if result then - local rand = math.random(1, 5) - get_guns.warelock_send = { - { os.time() + rand, false }, - { os.time() + config.data.get_guns.warelock_time + rand, true } - } - end - end - table.remove(get_guns.messages, 1) - end 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 @@ -1979,6 +1951,22 @@ function setKeys() until #key_combo > 0 and not isPress return key_combo end +function isPlayerInWarehouse() + local position = { + { 1379.8171, -20.1072, 1000.9240 }, + { 254.3029, 10.9711, 1504.5144 }, + { -225.0700, -74.8219, 1497.3340 } + } + local result = false + for i = 1, #position do + local x, y, z = getCharCoordinates(PLAYER_PED) + local dist = getDistanceBetweenCoords3d(x, y, z, position[i][1], position[i][2], position[i][3]) + if dist < 20.0 then + result = true + end + end + return result +end -->> UPDATE MODULE function openURL(url, fpath, message_off)