added chat & bump version 05.02.2023

update
rubin 2 years ago
parent 89b1607159
commit 4670b88301
  1. 4
      changelog
  2. 38
      mafia-tools.lua
  3. 2
      version

@ -17,4 +17,6 @@
Все логи и тайминги на ffixcar как и таймеры аммо хранятся на стороне сервера
Добавлены функции вкл/выкл на показ таймеров mhcars и ffixcar
Версия от 04.02.2023
Добавлен чекер мафии по клистам и по скинам
Добавлен чекер мафии по клистам и по скинам
Версия от 05.02.2023
Добавлен чат для тестеров /maf [text]

@ -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 ""

@ -1 +1 @@
04.02.2023
05.02.2023
Loading…
Cancel
Save