From 1f2e8af3ab44fd3e339847ba54c4dee87d2c2ad8 Mon Sep 17 00:00:00 2001 From: rubin Date: Sun, 5 Feb 2023 21:40:59 +0300 Subject: [PATCH] added msg /f after invite --- mafia-tools.lua | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/mafia-tools.lua b/mafia-tools.lua index f01eb27..a4d1327 100644 --- a/mafia-tools.lua +++ b/mafia-tools.lua @@ -143,7 +143,7 @@ menu.update = function() end end menu.show = { true, "main" } - end, config.data.room} + end, config.data.room, "Введите название комнаты!"} end }, { -->> Участники @@ -289,7 +289,7 @@ menu.update = function() end end menu.show = { true, "main" } - end, config.data.invite_helper.lvl} + end, config.data.invite_helper.lvl, "Введите минимальный уровень для инвайта!"} end }, { -->> Авто ранг вкл выкл @@ -313,7 +313,20 @@ menu.update = function() end end menu.show = { true, "main" } - end, config.data.invite_helper.rank} + end, config.data.invite_helper.rank, "Введите какой ранг давать после инвайта!"} + end + }, + { -->> Сообщение в чат после инвайта + title = "{"..config.data.font.color1.."}"..">{ffffff} Сообщение в рацию\t"..config.data.invite_helper.message, + click = function(button, list, input , outs) + if button ~= 1 then return end + menu.show = { true, "edit", function(button, list, input, outs) + if button == 1 then + config.data.invite_helper.message = input + config.save(config.data) + end + menu.show = { true, "main" } + end, config.data.invite_helper.message, "{name} - Заменится на никнейм игрока которого приняли\nЧтобы не отправлять сообщение оставьте поле пустым!"} end }, { -->> Клавиша инвайта @@ -343,7 +356,7 @@ menu.update = function() ["edit"] = { settings = {title = "mafia-tools" ,style = 1 ,btn1 = "Выбрать" ,btn2 = "Назад" ,forward = "{ffffff}" ,backwards = "\n" ,score = true}, { - text = "", + text = menu.show[5], { click = function(button, list, input, outs) menu.show[3](button, list, input, outs) @@ -423,6 +436,10 @@ invite_helper.onServerMessage = function(color, message) end end end + if #config.data.invite_helper.message > 0 then + name = name:gsub("_", " ") + antiflood.send[#antiflood.send+1] = string.format("/r %s", config.data.invite_helper.message:gsub("{name}", name)) + end end end invite_helper.onSendCommand = function(cmd) @@ -789,7 +806,8 @@ config.default = { lvl = 7, auto_rank = true, rank = 7, - key = "VK_I" + key = "VK_I", + message = "Добро пожаловать, {name}!" } } config.directory = string.format("%s\\moonloader\\config\\%s\\", getGameDirectory(), thisScript().name) @@ -1255,5 +1273,6 @@ utf8({ "sampAddChatMessage" }, "Utf8ToAnsi") utf8({ "print" }, "Utf8ToAnsi") utf8({ "renderGetFontDrawTextLength" }, "Utf8ToAnsi") utf8({ "renderFontDrawText" }, "Utf8ToAnsi") +utf8({ "sampSetCurrentDialogEditboxText" }, "Utf8ToAnsi") utf8({ "sampHasDialogRespond" }, nil, "AnsiToUtf8") utf8({ "sampev", "onServerMessage" }, "AnsiToUtf8", "Utf8ToAnsi") \ No newline at end of file