diff --git a/changelog b/changelog index 5a1e4f0..eff65dd 100644 --- a/changelog +++ b/changelog @@ -17,4 +17,6 @@ Все логи и тайминги на ffixcar как и таймеры аммо хранятся на стороне сервера Добавлены функции вкл/выкл на показ таймеров mhcars и ffixcar Версия от 04.02.2023 - Добавлен чекер мафии по клистам и по скинам \ No newline at end of file + Добавлен чекер мафии по клистам и по скинам +Версия от 05.02.2023 + Добавлен чат для тестеров /maf [text] \ No newline at end of file diff --git a/mafia-tools.lua b/mafia-tools.lua index 65f5a02..023b9e4 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -1,6 +1,6 @@ script_name('mafia-tools') script_author("Serhiy_Rubin") -script_version("04.02.2023") +script_version("05.02.2023") sampev = require 'samp.events' inicfg = require "inicfg" @@ -284,9 +284,23 @@ menu.update = function() end menu.show = { false, "main" } menu.put = "" +af_chat = 0 menu.loop = function() sampRegisterChatCommand('maf', function(param) - menu.show = { true, "main" } + if #param > 0 then + if os.time() - af_chat < 60 then + addChatMessage("Не чаще чем раз в минуту!") + else + request.send[#request.send + 1] = { + key = "messages", + text = AnsiToUtf8(param) + } + request.wait = 0 + af_chat = os.time() + end + else + menu.show = { true, "main" } + end end) while true do wait(0) @@ -362,7 +376,6 @@ mafia_checker.loop = function() end end - -->> MSK TIME msk_time = {} msk_time.update = 0 @@ -376,6 +389,7 @@ end -->> REQUEST request = {} +request.chat = {} request.send = {} request.base = {} request.loop = function() @@ -397,6 +411,7 @@ request.loop = function() if result then local result = pcall(request.handler, text) if not result then + addChatMessage(text) addChatMessage("Сервер 'mafia-tools' не отвечает!") break end @@ -453,6 +468,22 @@ request.handler = function(text) end end menu.ffixcar_log = text + for sender, sender_data in pairs(info["chat"]) do + if isPlayerInList(sender) then + local key = string.format("%d%s", sender_data.time, sender_data.text) + if request.chat[key] == nil then + request.chat[key] = true + local dev = "" + if sender == "Serhiy_Rubin" or sender == "Rafael_Moreno" then + dev = "[Разработчик] " + end + if msk_time.get() - sender_data.time < 15 then + local text = string.format("%s%s: %s", dev, sender, sender_data.text) + addChatMessage(text) + end + end + end + end end return true end @@ -510,7 +541,6 @@ ammo_timer.data = { } ammo_timer.loop = function() font = renderCreateFont(config.data.font.name,config.data.font.size,config.data.font.flag) - local getText = function(key) if config.data.timer_hud[key] ~= nil and not config.data.timer_hud[key] then return "" diff --git a/version b/version index 0bf9173..be02e9f 100644 --- a/version +++ b/version @@ -1 +1 @@ -04.02.2023 \ No newline at end of file +05.02.2023 \ No newline at end of file