From 29463537b65f7c178f0cc0a4ed49d318fe1afbbf Mon Sep 17 00:00:00 2001 From: rubin Date: Sun, 12 Feb 2023 21:39:52 +0300 Subject: [PATCH] added getgun not arm --- mafia-tools.lua | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index 2a1c24a..60c8468 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -811,13 +811,7 @@ armoff.loop = function() end end if os.time() - armoff.time < 3 and #config.data.armoff > 0 then - local result = false - for i = 1, #config.data.armoff do - if config.data.armoff[i] == armoff.id then - result = true - end - end - if result then + if armoff.check() then local arm = getCharArmour(PLAYER_PED) if arm > 0 and (armoff.antiflood == nil or os.time() - armoff.antiflood > 3) then armoff.antiflood = os.time() @@ -827,6 +821,17 @@ armoff.loop = function() end end end +armoff.check = function() + local result = false + if os.time() - armoff.time < 3 then + for i = 1, #config.data.armoff do + if config.data.armoff[i] == armoff.id then + result = true + end + end + end + return result +end -- HEALME @@ -1226,7 +1231,9 @@ get_guns.start_get = function() if config.data.get_guns.list[i][2] > 0 then if get_guns.weapon[config.data.get_guns.list[i][3]] == nil or get_guns.weapon[config.data.get_guns.list[i][3]] < (config.data.get_guns.list[i][4] * config.data.get_guns.list[i][2]) then for n = 1, config.data.get_guns.list[i][2] do - get_guns.list[#get_guns.list+1] = i - 1 + if i ~= 7 or (i == 7 and not armoff.check()) then + get_guns.list[#get_guns.list+1] = i - 1 + end end end end @@ -1428,13 +1435,12 @@ request.loop = function() request.wait = 0 while true do wait(0) - if os.time() - request.wait >= 5 then + if isPlayerInMafia() and os.time() - request.wait >= 5 then --> Может ли игрок открыть склад? local can_warelock = false if config.data.stats.rank >= 8 and config.data.get_guns.warelock_auto then can_warelock = true end - request.wait = os.time() local request_table = { sender = getLocalPlayerNickname(), @@ -1443,7 +1449,8 @@ request.loop = function() send = request.send, can_warelock = can_warelock, request_warelock = request.warelock, - rand = os.clock() + rand = os.clock(), + frac = config.data.stats.frac } request.send = {} request.warelock = false