fixed bugs & bump version

master
rubin 2 weeks ago
parent 18f4cd613c
commit 9eb4399b17
  1. 5
      changelog
  2. 72
      mafia-tools.lua
  3. 2
      version

@ -37,4 +37,7 @@
Версия от 20.07.2023
Добавлена поддержка сервера Underground
Версия от 05.07.2025
Фикс флуда перегона
Фикс флуда перегона
Версия от 28.11.2025
Фикс не выключался флуд перегона
Фикс не сохранялись после релога armoff id

@ -1,6 +1,6 @@
script_name('mafia-tools')
script_author("Serhiy_Rubin")
script_version("05.07.2025")
script_version("28.11.2025")
sampev = require 'samp.events'
inicfg = require "inicfg"
@ -1078,43 +1078,45 @@ end
mhcars = {}
mhcars.time = 0
mhcars.onServerMessage = function(color, message)
if message == " Вы не являетесь лидером/замом мафии" or
message == " Ожидайте принятия задания" or
message == " Задание уже начато" or
message:find("Перегон был инициирован мафией ") then
mhcars.time = os.time() + 1800
end
if message == " Задание по перегону машин завершено" then
mhcars.time = 0
end
if message:find("^ Задание будет доступно через: ") then
local p1, p2, p3 = string.match(message, "Задание будет доступно через: (%d+):(%d+):(%d+)")
if(p3 == nil)then
p1, p2 = string.match(message, "Задание будет доступно через: (%d+):(%d+)")
end
if(p1 ~= nil and p2 ~= nil)then
local mhTimer = 0
if(p3 ~= nil)then
mhTimer = tonumber(p1) * 3600
mhTimer = mhTimer + (tonumber(p2) * 60)
mhTimer = mhTimer + tonumber(p3)
else
mhTimer = mhTimer + (tonumber(p1) * 60)
mhTimer = mhTimer + tonumber(p2)
if config.data.mhcars.auto then
if message == " Вы не являетесь лидером/замом мафии" or
message == " Ожидайте принятия задания" or
message == " Задание уже начато" or
message:find("Перегон был инициирован мафией ") then
mhcars.time = os.time() + 1800
end
if message == " Задание по перегону машин завершено" then
mhcars.time = 0
end
if message:find("^ Задание будет доступно через: ") then
local p1, p2, p3 = string.match(message, "Задание будет доступно через: (%d+):(%d+):(%d+)")
if(p3 == nil)then
p1, p2 = string.match(message, "Задание будет доступно через: (%d+):(%d+)")
end
mhcars.time = os.time() + mhTimer - config.data.mhcars.offset_wait
request.send[#request.send + 1] = {
key = "mhcars",
second = mhTimer
}
request.wait = 0
end
end --> by Richard_Holmes
if(p1 ~= nil and p2 ~= nil)then
local mhTimer = 0
if(p3 ~= nil)then
mhTimer = tonumber(p1) * 3600
mhTimer = mhTimer + (tonumber(p2) * 60)
mhTimer = mhTimer + tonumber(p3)
else
mhTimer = mhTimer + (tonumber(p1) * 60)
mhTimer = mhTimer + tonumber(p2)
end
mhcars.time = os.time() + mhTimer - config.data.mhcars.offset_wait
request.send[#request.send + 1] = {
key = "mhcars",
second = mhTimer
}
request.wait = 0
end
end --> by Richard_Holmes
end
end
mhcars.loop = function()
while true do
wait(0)
if sampIsLocalPlayerSpawned() and isPlayerInMafia() and config.data.stats.rank >= 9 then
if sampIsLocalPlayerSpawned() and isPlayerInMafia() and config.data.mhcars.auto and config.data.stats.rank >= 9 then
if mhcars.time == 0 then
if mhcars.antiflood == nil or os.time() - mhcars.antiflood > 1 then
mhcars.antiflood = os.time()
@ -1936,11 +1938,11 @@ config.init = function()
config.save(config.default)
end
config.read()
for k,v in pairs(config.default) do
for k,v in pairs(config.default) doА
if config.data[k] == nil then
config.data[k] = v
end
if type(v) == "table" then
if type(v) == "table" and k ~= "armoff" then
for kk,vv in pairs(v) do
if config.data[k][kk] == nil then
config.data[k][kk] = vv

@ -1 +1 @@
05.07.2025
28.11.2025
Loading…
Cancel
Save