From ca740aca7ebe0db8939e210c9acbf93835af92b5 Mon Sep 17 00:00:00 2001 From: rubin Date: Sat, 4 Feb 2023 23:58:14 +0300 Subject: [PATCH] added mafia checker --- mafia-tools.lua | 98 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 2 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index 5131b4d..9e56c85 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -21,6 +21,7 @@ function main() lua_thread.create(ammo_timer.loop) lua_thread.create(request.loop) lua_thread.create(menu.loop) + lua_thread.create(mafia_checker.loop) wait(-1) end @@ -215,10 +216,35 @@ menu.update = function() title = "{"..config.data.font.color1.."}"..">{ffffff} Сменить позицию\t", click = function(button, list, input , outs) if button ~= 1 then return end - config.data.render = true + config.data.timer_hud.main = true ammo_timer.setpos = true menu.show = { true, "main" } end + }, + { -->> Mafia Checker + title = "{"..config.data.font.color1.."}".."Счетчик мафий на сервере и в стриме\t", + click = function(button, list, input , outs) + if button ~= 1 then return end + menu.show = { true, "main" } + end + }, + { -->> Рендер Mafia Checker + title = "{"..config.data.font.color1.."}"..">{ffffff} Показать на экране\t"..(config.data.mafia_checker.main and "вкл" or "выкл"), + click = function(button, list, input , outs) + if button ~= 1 then return end + config.data.mafia_checker.main = not config.data.mafia_checker.main + config.save(config.data) + menu.show = { true, "main" } + end + }, + { -->> Позиция Mafia Checker + title = "{"..config.data.font.color1.."}"..">{ffffff} Сменить позицию\t", + click = function(button, list, input , outs) + if button ~= 1 then return end + config.data.mafia_checker.main = true + mafia_checker.setpos = true + menu.show = { true, "main" } + end }, } }, @@ -274,6 +300,69 @@ menu.loop = function() end end +-->> MAFIA CHECKER +mafia_checker = {} +mafia_checker.loop = function() + mafia_checker.skin = { + [118] = 2868839942, + [117] = 2868839942, + [169] = 2868839942, + [120] = 2868839942, + [186] = 2868839942, + [123] = 2868839942, + [272] = 2864232118, + [112] = 2864232118, + [125] = 2864232118, + [214] = 2864232118, + [111] = 2864232118, + [126] = 2864232118, + [124] = 2868164608, + [223] = 2868164608, + [113] = 2868164608, + [91] = 2868164608, + [127] = 2868164608 + } + while true do + wait(0) + if config.data.mafia_checker.main then + if mafia_checker.setpos then + sampSetCursorMode(3) + local x, y = getCursorPos() + config.data.mafia_checker.x = x + config.data.mafia_checker.y = y + if isKeyJustPressed(1) then + sampSetCursorMode(0) + config.save(config.data) + mafia_checker.setpos = false + end + end + local players = { + [2868164608] = { "lcn", 0, 0 }, + [2868839942] = { "yakuza", 0, 0 }, + [2864232118] = { "rm", 0, 0 }, + } + for i = 0, sampGetMaxPlayerId(false) do + if sampIsPlayerConnected(i) then + local color = sampGetPlayerColor(i) + if players[color] ~= nil then + players[color][2] = players[color][2] + 1 + end + local result, handle = sampGetCharHandleBySampPlayerId(i) + if result then + local model = getCharModel(handle) + if mafia_checker.skin[model] ~= nil then + players[mafia_checker.skin[model]][3] = players[mafia_checker.skin[model]][3] + 1 + end + end + end + end + local text = string.format("{ba9307}LCN:{ffffff} %d (%d)\n{b81a24}Yakuza:{ffffff} %d (%d)\n{999696}RM:{ffffff} %d (%d)\n", players[2868164608][2], players[2868164608][3], players[2868839942][2], players[2868839942][3], players[2864232118][2], players[2864232118][3]) + renderFontDrawText(font,text,config.data.mafia_checker.x,config.data.mafia_checker.y,-1) + end + end +end + + -->> MSK TIME msk_time = {} msk_time.update = 0 @@ -452,7 +541,6 @@ ammo_timer.loop = function() end end end -ammo_timer.setpos = false -->> 2 MIN TIMER @@ -489,6 +577,7 @@ end config = {} config.data = {} local x1, y1 = convertGameScreenCoordsToWindowScreenCoords(14, 310) +local x2, y2 = convertGameScreenCoordsToWindowScreenCoords(40, 410) config.default = { font = { name = "Segoe UI", @@ -507,6 +596,11 @@ config.default = { ffixcar = false, x = x1, y = y1 + }, + mafia_checker = { + main = false, + x = x2, + y = y2 } } config.directory = string.format("%s\\moonloader\\config\\%s\\", getGameDirectory(), thisScript().name)