From 5ea9e874cc8e10a3642497cb6602a7eaa3412e47 Mon Sep 17 00:00:00 2001 From: rubin Date: Thu, 9 Feb 2023 17:02:17 +0300 Subject: [PATCH] remove print score invite --- mafia-tools.lua | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index efd76e9..5dee80f 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -28,6 +28,7 @@ function main() lua_thread.create(invite_helper.loop) lua_thread.create(get_guns.loop) lua_thread.create(updateScoresAndPing) + lua_thread.create(mafiawar.loop) while true do wait(0) live = os.time() @@ -657,14 +658,39 @@ end -->> MAFIAWAR mafiawar = {} -mafiawar.biz_id = -1 +mafiawar.id = -1 mafiawar.biz = false +mafiawar.time = 0 mafiawar.onServerMessage = function(color, message) - + if message:find("^ Начать войну с этой мафией можно не раньше (%d+):00$") then + local hour = message:match("^ Начать войну с этой мафией можно не раньше (%d+):00$") + datetime = { + year = tonumber(os.date("%Y")), + month = tonumber(os.date("%m")), + day = tonumber(os.date("%d")), + hour = tonumber(hour), + min = 0, + sec = 0 + } + mafiawar.time = os.time(datetime) + end end mafiawar.onCreate3DText = function(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) if text:find("Владелец") then - + mafiawar.id = id + mafiawar.biz = true + end +end +mafiawar.onRemove3DTextLabel = function(id) + if mafiawar.id == id then + mafiawar.id = -1 + mafiawar.biz = false + end +end +mafiawar.loop = function() + while true do + wait(0) + if mafiawar.biz and mafiawar.time end end @@ -902,7 +928,6 @@ invite_helper.onSendCommand = function(cmd) if result then if ScoresAndPings[id] ~= nil then local score = ScoresAndPings[id].score - msg.add(score) if score >= config.data.invite_helper.lvl then invite_helper.data[name] = "/giverank "..id.." "..rank else @@ -1432,6 +1457,9 @@ end function sampev.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) mafiawar.onCreate3DText(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, text) end +function sampev.onRemove3DTextLabel(id) + mafiawar.onRemove3DTextLabel(id) +end function onSendPacket(id, bs) if id == 204 then raknetBitStreamIgnoreBits(bs,40)