From e02638b2250e7be48666b1985e1183e4e91eaa1c Mon Sep 17 00:00:00 2001 From: rubin Date: Mon, 23 Jan 2023 20:09:36 +0300 Subject: [PATCH] added UTF-8 module --- TruckHUD.lua | 1023 ++++++++++++++++++++++++++------------------------ changelog | 14 +- 2 files changed, 549 insertions(+), 488 deletions(-) diff --git a/TruckHUD.lua b/TruckHUD.lua index a75c5e2..ed9104b 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -7,6 +7,9 @@ local dlstatus = require("moonloader").download_status local vkeys = require "lib.vkeys" local ffi = require("ffi") +local encoding = require "encoding" +encoding.default = "CP1251" +local u8 = encoding.UTF8 ffi.cdef [[ bool SetCursorPos(int X, int Y); ]] @@ -19,52 +22,52 @@ end ------- 3d text local id_3D_text = os.time() -local what_is_uploaded = {[0] = "", [1] = "", [2] = "", [3] = ""} +local what_is_uploaded = {[0] = "Нет", [1] = "Нефть", [2] = "Уголь", [3] = "Дерево"} local texts_of_reports = { - ["n1"] = " 1", - ["n2"] = " 2", - ["y1"] = " 1", - ["y2"] = " 2", - ["l1"] = " 1", - ["l2"] = " 2", - ["lsn"] = " ", - ["lsy"] = " ", - ["lsl"] = " ", - ["sfn"] = " ", - ["sfy"] = " ", - ["sfl"] = " " + ["n1"] = "Нефтезаводе №1", + ["n2"] = "Нефтезаводе №2", + ["y1"] = "Складе Угля №1", + ["y2"] = "Складе Угля №2", + ["l1"] = "Лесопилке №1", + ["l2"] = "Лесопилке №2", + ["lsn"] = "Нефть в ЛС", + ["lsy"] = "Уголь в ЛС", + ["lsl"] = "Дерево в ЛС", + ["sfn"] = "Нефть в СФ", + ["sfy"] = "Уголь в СФ", + ["sfl"] = "Дерево в СФ" } local dop_chat_light = { - " 1", " 2", " 1", " 2", " 1", " 2", " ", " ", " ", " ", " ", " ", " ", " " + "Нефтезавод №1", "Нефтезавод №2", "Склад Угля №1", "Склад Угля №2", "Лесопилку №1", "Лесопилку №2", "Нефть в Порт ЛС", "Нефть в Порт СФ", "Уголь в Порт ЛС", "Уголь в Порт СФ", "Дерево в Порт ЛС", "Дерево в Порт СФ", " в Порт ЛС", " в Порт СФ" } for k,v in pairs(texts_of_reports) do dop_chat_light[#dop_chat_light+1] = v end local find_3dText = { - ["n1"] = " 1.* : 0.(%d+)", - ["n2"] = " 2.* : 0.(%d+)", - ["y1"] = " 1.* : 0.(%d+)", - ["y2"] = " 2.* : 0.(%d+)", - ["l1"] = " 1.* : 0.(%d+)", - ["l2"] = " 2.* : 0.(%d+)", - ["ls"] = " .*: 0.(%d+).*: 0.(%d+).*: 0.(%d+)", - ["sf"] = " .*: 0.(%d+).*: 0.(%d+).*: 0.(%d+)" + ["n1"] = "Нефтезавод №1.*Цена груза: 0.(%d+)", + ["n2"] = "Нефтезавод №2.*Цена груза: 0.(%d+)", + ["y1"] = "Склад угля №1.*Цена груза: 0.(%d+)", + ["y2"] = "Склад угля №2.*Цена груза: 0.(%d+)", + ["l1"] = "Лесопилка №1.*Цена груза: 0.(%d+)", + ["l2"] = "Лесопилка №2.*Цена груза: 0.(%d+)", + ["ls"] = "Порт ЛС.*Нефть: 0.(%d+).*Уголь: 0.(%d+).*Дерево: 0.(%d+)", + ["sf"] = "Порт СФ.*Нефть: 0.(%d+).*Уголь: 0.(%d+).*Дерево: 0.(%d+)" } local menu = { [1] = {[1] = "TruckHUD: {06940f}ON", [2] = "TruckHUD: {d10000}OFF", run = false}, [2] = {[1] = "Load/Unload: {06940f}ON", [2] = "Load/Unload: {d10000}OFF", run = false}, - [3] = {[1] = "-: {06940f}ON", [2] = "-: {d10000}OFF", run = false}, - [4] = {[1] = "SMS Serhiy_Rubin[777]", [2] = " : {d10000}OFF", run = false}, - [5] = {[1] = "-: ", [2] = "-: ", run = false}, - [6] = {[1] = " ", [2] = " ", run = false}, - [7] = {[1] = " ", [2] = " ", run = false}, - [8] = {[1] = "", [2] = "", run = false}, - [9] = {[1] = " ", [2] = " ", run = false}, - [10] = {[1] = " ", [2] = " ", run = false}, - [11] = {[1] = " ", [2] = " ", run = false}, - [12] = {[1] = " ", [2] = " ", run = false} + [3] = {[1] = "Авто-Доклад: {06940f}ON", [2] = "Авто-Доклад: {d10000}OFF", run = false}, + [4] = {[1] = "SMS » Serhiy_Rubin[777]", [2] = "Режим пары: {d10000}OFF", run = false}, + [5] = {[1] = "Соло-Чекер: ", [2] = "Соло-Чекер: ", run = false}, + [6] = {[1] = "Дальнобойщики онлайн", [2] = "Дальнобойщики онлайн", run = false}, + [7] = {[1] = "Дальнобойщики со скриптом", [2] = "Дальнобойщики со скриптом", run = false}, + [8] = {[1] = "Настройки", [2] = "Настройки", run = false}, + [9] = {[1] = "Мониторинг цен", [2] = "Мониторинг цен", run = false}, + [10] = {[1] = "Купить груз", [2] = "Купить груз", run = false}, + [11] = {[1] = "Продать груз", [2] = "Продать груз", run = false}, + [12] = {[1] = "Восстановить груз", [2] = "Восстановить груз", run = false} } @@ -75,7 +78,7 @@ local pair_afk_stop = { } -local pair_mode, sms_pair_mode, report_text, pair_mode_id, pair_mode_name, BinderMode = false, "", "", -1, "", true +local pair_mode, sms_pair_mode, report_text, pair_mode_id, pair_mode_name, BinderMode = false, "", "", -1, "Нет", true local script_run, control, auto, autoh, wait_auto, pos = false, false, false, true, 0, {[1] = false, [2] = false, [3] = false} @@ -123,31 +126,31 @@ parking_pair = { [2] = { -1048.6430664063, -660.54699707031, 33.012603759766, 10.0 } -- N2 }, { - [1] = { 839.09020996094, 880.17510986328, 14.3515625, 15.0 }, -- 1 - [2] = { -2913.8544921875, -1377.0952148438, 12.762256622314, 25.0 } -- 2 + [1] = { 839.09020996094, 880.17510986328, 14.3515625, 15.0 }, -- У1 + [2] = { -2913.8544921875, -1377.0952148438, 12.762256622314, 25.0 } -- У2 }, { - [1] = { -457.45620727539, -53.193939208984, 60.938865661621, 15.0 }, -- 1 - [2] = { -1963.6184082031, -2438.9055175781, 31.625, 25.0 } -- 2 + [1] = { -457.45620727539, -53.193939208984, 60.938865661621, 15.0 }, -- Л1 + [2] = { -1963.6184082031, -2438.9055175781, 31.625, 25.0 } -- Л2 }, { - [1] = { 2507.0256, -2234.2151, 13.5469, 30.0 }, -- - [2] = { -1731.5022, 118.8936, 3.5547, 30.0 } -- + [1] = { 2507.0256, -2234.2151, 13.5469, 30.0 }, -- ЛС + [2] = { -1731.5022, 118.8936, 3.5547, 30.0 } -- СФ } } pair_ready = false player_ready = false location_pos = { - [" 1"] = {x = 256.02127075195, y = 1414.8492431641, z = 10.232398033142}, - [" 1"] = {x = 832.10766601563, y = 864.03668212891, z = 11.643839836121}, - [" 1"] = {x = -448.91455078125, y = -65.951385498047, z = 58.959014892578}, - [" 2"] = {x = -1046.7521972656, y = -670.66937255859, z = 31.885597229004}, - [" 2"] = {x = -2913.8544921875, y = -1377.0952148438, z = 10.762256622314}, - [" 2"] = {x = -1978.8649902344, y = -2434.9421386719, z = 30.192840576172}, - [" "] = {x = 2507.02, y = -2234.05, z = 13.55}, - [" "] = {x = -1731.5022, y = 118.8936, z = 3.5547}, - [""] = {x = 2239.8333, y = 2779.6016, z = 10.8203} + ["Нефть 1"] = {x = 256.02127075195, y = 1414.8492431641, z = 10.232398033142}, + ["Уголь 1"] = {x = 832.10766601563, y = 864.03668212891, z = 11.643839836121}, + ["Лес 1"] = {x = -448.91455078125, y = -65.951385498047, z = 58.959014892578}, + ["Нефть 2"] = {x = -1046.7521972656, y = -670.66937255859, z = 31.885597229004}, + ["Уголь 2"] = {x = -2913.8544921875, y = -1377.0952148438, z = 10.762256622314}, + ["Лес 2"] = {x = -1978.8649902344, y = -2434.9421386719, z = 30.192840576172}, + ["Порт ЛС"] = {x = 2507.02, y = -2234.05, z = 13.55}, + ["Порт СФ"] = {x = -1731.5022, y = 118.8936, z = 3.5547}, + ["Аренда"] = {x = 2239.8333, y = 2779.6016, z = 10.8203} } location_keys = { ["n1"] = {x = 256.02127075195, y = 1414.8492431641, z = 10.232398033142, }, @@ -177,8 +180,8 @@ function main() try(function() sampev = require "lib.samp.events" end, function(e) - sampAddChatMessage(">> TruckHUD: 'samp.events' (SAMP.lua)", 0xff0000) - sampAddChatMessage(">> TruckHUD: https://vk.com/rubin.mods",0xff0000) + sampAddChatMessage(">> TruckHUD: Отсутствует модуль 'samp.events' (SAMP.lua)", 0xff0000) + sampAddChatMessage(">> Официальная страница TruckHUD: https://vk.com/rubin.mods",0xff0000) thisScript():unload() end) loadEvents() @@ -261,7 +264,7 @@ function settings_load() local x2, y2 = convertGameScreenCoordsToWindowScreenCoords(146.17861938477, 345.91665649414) local x3, y3 = convertGameScreenCoordsToWindowScreenCoords(529.42901611328, 158.08332824707) defaultMon = -[[!mn!: {FFFFFF}!skill! [!skill_poc!%] [!skill_reys!]!n!: {FFFFFF}!rang! [!rang_poc!%] [!rang_reys!]!n!!mn!:{FFFFFF} !zp_hour!/!max_zp!!n!: {FFFFFF}!profit!!n!: {FFFFFF}!reys_hour!/!reys_day! [!left_reys!] ]] +[[!mn!Скилл: {FFFFFF}!skill! [!skill_poc!%] [!skill_reys!]!n!Ранг: {FFFFFF}!rang! [!rang_poc!%] [!rang_reys!]!n!!mn!Зарплата:{FFFFFF} !zp_hour!/!max_zp!!n!Прибыль: {FFFFFF}!profit!!n!Рейсы: {FFFFFF}!reys_hour!/!reys_day! [!left_reys!] ]] local table_std = { Settings = { binder_sms_mode = false, @@ -331,8 +334,8 @@ function settings_load() time = 0, n1 = 0, n2 = 0, y1 = 0, y2 = 0, l1 = 0, l2 = 0, lsn = 0, lsy = 0, lsl = 0, sfn = 0, sfy = 0, sfl = 0 }, - binder = { '/r ', '/r ', '/r ', '/r ' }, - binder_sms = { '/sms ! ', '/sms ! ', '/sms ! ', '/sms ! ' }, + binder = { '/r На месте', '/r Загружаюсь', '/r Задержусь', '/r Разгружаюсь' }, + binder_sms = { '/sms !ИдПары На месте', '/sms !ИдПары Загружаюсь', '/sms !ИдПары Задержусь', '/sms !ИдПары Разгружаюсь' }, blacklist = {} } if not doesFileExist(AdressJson) then @@ -351,7 +354,7 @@ function settings_load() if file then inifiles = decodeJson(file:read("*a")) if inifiles == nil then - sampAddChatMessage("[TruckHUD] ! !", 0xff0000) + sampAddChatMessage("[TruckHUD] Ошибка чтения конфига! Сбрасываю конфиг!", 0xff0000) local file, error = io.open(AdressJson, "w") if file ~= nil then file:write(encodeJson(table_std)) @@ -364,7 +367,7 @@ function settings_load() end local result = pcall(readJson) if not result then - sampAddChatMessage("[TruckHUD] ! !", 0xff0000) + sampAddChatMessage("[TruckHUD] Ошибка чтения конфига! Сбрасываю конфиг!", 0xff0000) local file, error = io.open(AdressJson, "w") if file ~= nil then file:write(encodeJson(table_std)) @@ -376,7 +379,7 @@ function settings_load() if inifiles ~= nil then if error_ini ~= nil then - sampAddChatMessage("[TruckHUD] !", 0xff0000) + sampAddChatMessage("[TruckHUD] Конфиг был успешно загружен!", 0xff0000) error_ini = nil end for k,v in pairs(table_std) do @@ -394,7 +397,7 @@ function settings_load() settings_save() else error_ini = true - sampAddChatMessage("[TruckHUD] ! ", 0xff0000) + sampAddChatMessage("[TruckHUD] Ошибка чтения конфига! Пробую ещё раз прочесть", 0xff0000) settings_load() end end @@ -427,9 +430,9 @@ function doControl() local plus = (renderGetFontDrawHeight(font) + (renderGetFontDrawHeight(font) / 10)) Y = ((Y / 2.2) - (renderGetFontDrawHeight(font) * 3)) for i = 1, 12 do - local string_render = (menu[i].run and menu[i][1] or menu[i][2]) + local string_render = menu[i].run and menu[i][1] or menu[i][2] if i == 5 then - local text = { "{d10000}OFF", "{06940f}", "{06940f}", "{06940f}", "{06940f}" } + local text = { "{d10000}OFF", "{06940f}Нефть", "{06940f}Уголь", "{06940f}Дерево", "{06940f}Все" } if text[inifiles.Settings.luCheckerCargo+1] ~= nil then string_render = string.format("%s%s", string_render, text[inifiles.Settings.luCheckerCargo+1]) end @@ -492,7 +495,7 @@ function doControl() if i == 4 and pair_mode and drawClickableText( - "{e30202}", + "{e30202}х", ((X / 2) + (renderGetFontDrawTextLength(font, menu[4][1] .. " ") / 2)), Y ) @@ -574,12 +577,12 @@ end function doDialog() local result, button, list, input = sampHasDialogRespond(222) local caption = sampGetDialogCaption() - if caption:find('Truck%-HUD: ') then + if caption:find('Truck%-HUD: Блокировка') then if result then doLocalBlock(button, list, input, caption) end end - if caption == "Truck-HUD: " then + if string.find(caption, 'Truck%-HUD: Настройки') then if result and button == 1 then if dialogLine ~= nil and dialogLine[list + 1] ~= nil then local str = dialogLine[list + 1] @@ -587,86 +590,86 @@ function doDialog() script_run = not script_run ShowDialog1(1) end - if str:find(" ") then + if str:find("Сменить позицию статистики с таймером") then wait(100) pos[1] = true end - if str:find(" ") then + if str:find("Сменить позицию мониторинга цен") then wait(100) pos[2] = true end - if str:find(" ") then + if str:find("Сменить позицию биндера") then wait(100) pos[3] = true end - if str:find(" ") then + if str:find("Доклады по клику на цены") then inifiles.Settings.binder_sms_mode = not inifiles.Settings.binder_sms_mode settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Редактировать формат статистики") then editbox_stats = true ShowDialog1(9) end if str:find("Cruise Control") then - if str:find("") then + if str:find("Кнопка") then ShowDialog1(4, 4) else inifiles.Settings.Cruise = not inifiles.Settings.Cruise if inifiles.Settings.Cruise then - sampAddChatMessage(' '..inifiles.Settings.Key4:gsub('VK_', '')..'. W.', -1) + sampAddChatMessage('Для активации когда едете нажмите '..inifiles.Settings.Key4:gsub('VK_', '')..'. Чтобы отключить нажмите W.', -1) end settings_save() ShowDialog1(1) end end - if str:find(" HUD") then + if str:find("Информация о напарнике на HUD") then inifiles.Settings.pairinfo = not inifiles.Settings.pairinfo settings_save() ShowDialog1(9) end - if str:find(" ") then + if str:find("Доклады в рацию") then inifiles.Settings.Report = not inifiles.Settings.Report menu[3].run = inifiles.Settings.Report settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Доклады от") then inifiles.Settings.girl = not inifiles.Settings.girl settings_save() ShowDialog1(1) end - if str:find(" /") then + if str:find("Авто загрузка/разгрузка") then auto = not auto menu[2].run = auto ShowDialog1(1) end - if str:find(" ") then + if str:find("Учитывать КД напарника") then inifiles.Settings.auto_load_unload_kd_pair_use = not inifiles.Settings.auto_load_unload_kd_pair_use settings_save() ShowDialog1(1) end - if str:find(" /") then + if str:find("Режим авто загрузки/разгрузки") then inifiles.Settings.AutoOFF = not inifiles.Settings.AutoOFF settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Информация на фурах дальнобойщиков") then inifiles.Settings.TruckRender = not inifiles.Settings.TruckRender settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Убрать тюнинг колес с фур") then inifiles.Settings.Tuning = not inifiles.Settings.Tuning settings_save() ShowDialog1(1) end - if str:find("") then + if str:find("Биндер") then inifiles.Settings.Binder = not inifiles.Settings.Binder settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Режим пары ") then if pair_mode then pair_mode = false menu[4].run = false @@ -675,7 +678,7 @@ function doDialog() ShowDialog1(8) end end - if str:find("") then + if str:find("Соло") then inifiles.Settings.luCheckerCargo = inifiles.Settings.luCheckerCargo + 1 if inifiles.Settings.luCheckerCargo >= 5 then inifiles.Settings.luCheckerCargo = 0 @@ -684,57 +687,57 @@ function doDialog() settings_save() ShowDialog1(1) end - if str:find(" SMS") then + if str:find("Доклады в SMS") then inifiles.Settings.SMSpara = not inifiles.Settings.SMSpara settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Подсветка напарника в чате") then inifiles.Settings.LightingPara = not inifiles.Settings.LightingPara settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Остановка фуры после разгрузки") then inifiles.Settings.Stop = not inifiles.Settings.Stop settings_save() ShowDialog1(1) end - if str:find("") then + if str:find("Синхронизация") then inifiles.Settings.transponder = not inifiles.Settings.transponder settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Карта с позицией") then inifiles.Settings.fastmap = not inifiles.Settings.fastmap settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Скрывать чат профсоюза") then inifiles.Settings.ChatOFF = not inifiles.Settings.ChatOFF settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("только в фуре") then inifiles.Settings.chat_in_truck = not inifiles.Settings.chat_in_truck settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Отправка мониторинга в чат") then inifiles.Settings.ChatDoklad = not inifiles.Settings.ChatDoklad settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Выделение Портов") then inifiles.Settings.highlight_jf = not inifiles.Settings.highlight_jf settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Выделение цены") then inifiles.Settings.LightingPrice = not inifiles.Settings.LightingPrice settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Цвет подсветки напарника") then if dialogTextToList[list + 1] ~= nil then ShowDialog1( 2, @@ -746,12 +749,12 @@ function doDialog() ) end end - if str:find("") then + if str:find("Шрифт") then if dialogTextToList[list + 1] ~= nil then ShowDialog1(2, dialogTextToList[list + 1], inifiles.Render.FontName, true, "Render", "FontName") end end - if str:find("") then + if str:find("Размер") then if dialogTextToList[list + 1] ~= nil then ShowDialog1( 2, @@ -763,7 +766,7 @@ function doDialog() ) end end - if str:find("") then + if str:find("Стиль") then if dialogTextToList[list + 1] ~= nil then ShowDialog1( 2, @@ -775,72 +778,72 @@ function doDialog() ) end end - if str:find(" ") then + if str:find("Цвет первый") then if dialogTextToList[list + 1] ~= nil then ShowDialog1(2, dialogTextToList[list + 1], inifiles.Render.Color1, true, "Render", "Color1") end end - if str:find(" ") then + if str:find("Цвет второй") then if dialogTextToList[list + 1] ~= nil then ShowDialog1(2, dialogTextToList[list + 1], inifiles.Render.Color2, true, "Render", "Color2") end end - if str:find(" %-") then + if str:find("Цена авто%-загрузки") then if dialogTextToList[list + 1] ~= nil then ShowDialog1(2, dialogTextToList[list + 1], inifiles.Price.Load, false, "Price", "Load") end end - if str:find(" %-") then + if str:find("Цена авто%-разгрузки") then if dialogTextToList[list + 1] ~= nil then ShowDialog1(2, dialogTextToList[list + 1], inifiles.Price.UnLoad, false, "Price", "UnLoad") end end - if str:find(" ") then + if str:find("Кнопка отображения меню") then ShowDialog1(4, 1) end - if str:find("") then + if str:find("Задержка") then inifiles.Settings.AutoWait = not inifiles.Settings.AutoWait settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Кнопка для работы без фуры") then ShowDialog1(4, 2) end - if str:find(" ") then + if str:find("Кнопка для отображения карты") then ShowDialog1(4, 3) end - if str:find(" ") then + if str:find("Локальная блокировка участников") then LocalBlock(1) end - if str:find(" ") then + if str:find("Уведомления когда Вас установили напарником") then inifiles.Settings.NewPairMSG = not inifiles.Settings.NewPairMSG settings_save() ShowDialog1(1) end - if str:find("%- ") then + if str:find("Авто%-Очистка неиспользуемой памяти скрипта") then inifiles.Settings.AutoClear = not inifiles.Settings.AutoClear settings_save() ShowDialog1(1) end - if str:find(" ") then + if str:find("Очистить неиспользуемую память скрипта") then local mem_do = string.format('%0.2f MB', (tonumber(gcinfo()) / 1000)) collectgarbage("step") - sampAddChatMessage(' . : '..mem_do..'. : '..string.format('%0.2f MB', (tonumber(gcinfo()) / 1000)), -1) + sampAddChatMessage('Памяти очищена. Было: '..mem_do..'. Стало: '..string.format('%0.2f MB', (tonumber(gcinfo()) / 1000)), -1) ShowDialog1(1) end - if str:find(" ") then + if str:find("Подробная статистика") then ShowStats(1) end - if str:find(" ") then + if str:find("Контакты автора") then ShowDialog1(3) end - if str:find(" ") then + if str:find("Перезагрузка скрипта") then thisScript():reload() end end end end - if caption == "Truck-HUD: " then + if caption == "Truck-HUD: Изменение настроек" then if d[7] then d[7] = false sampSetCurrentDialogEditboxText(inifiles[d[5]][d[6]]) @@ -870,7 +873,7 @@ function doDialog() end end end - if caption == "Truck-HUD: HUD" then + if caption == "Truck-HUD: Редактор HUD" then if result then if button == 1 then local text = getClipboardText() @@ -885,7 +888,7 @@ function doDialog() ShowDialog1(1) end end - if caption == "Truck-HUD: " then + if caption == "Truck-HUD: Контакты автора" then if result then if button == 1 then if list == 0 then @@ -909,7 +912,7 @@ function doDialog() end end end - if caption == 'Truck-HUD: ' then + if caption == 'Truck-HUD: Биндер' then if result then if button == 1 and #input > 0 then if d[2] == 1 then @@ -930,12 +933,12 @@ function doDialog() end end end - if caption == "Truck-HUD: " then + if caption == "Truck-HUD: Статистика" then if result then WhileShowStats(button, list) end end - if caption == "Truck-HUD: " then + if caption == "Truck-HUD: Режим пары" then if result then if button == 1 then if string.find(input, "(%d+)") then @@ -944,7 +947,7 @@ function doDialog() error_message(1, '') para_message_send = nil pair_mode_name = sampGetPlayerNickname(pair_mode_id) - menu[4][1] = "SMS " .. pair_mode_name .. "[" .. pair_mode_id .. "]" + menu[4][1] = "SMS » " .. pair_mode_name .. "[" .. pair_mode_id .. "]" pair_mode = true menu[4].run = true transponder_delay = 100 @@ -952,7 +955,7 @@ function doDialog() pair_mode_id = -1 pair_mode = false menu[4].run = false - sampAddChatMessage("! ID .", -1) + sampAddChatMessage("Ошибка! Игрок под этим ID не в сети.", -1) end end else @@ -969,13 +972,13 @@ function doPair() pair_mode = false menu[4].run = false sampAddChatMessage( - " " .. pair_mode_name .. "[" .. pair_mode_id .. "]" .. " . .", + "Напарник " .. pair_mode_name .. "[" .. pair_mode_id .. "]" .. " вышел из игры. Режим пары выключен.", -1 ) if auto then auto = false menu[2].run = false - sampAddChatMessage(" TruckHUD !", -1) + sampAddChatMessage("Режим АВТО TruckHUD выключен!", -1) end end @@ -1107,7 +1110,7 @@ function doRenderStats() local down = (renderGetFontDrawHeight(font) / 6) local height = (renderGetFontDrawHeight(font) - (renderGetFontDrawHeight(font) / 20)) if control then - if drawClickableText("{" .. c2 .. "}[ ]", X, Y) then + if drawClickableText("{" .. c2 .. "}[Смена позиции]", X, Y) then pos[1] = true end end @@ -1134,21 +1137,21 @@ function doRenderStats() (timer_secc >= 0 and (workload == 1 and string.format( - "{%s} {%s}%d:%02d", + "{%s}До разгрузки {%s}%d:%02d", inifiles.Render.Color1, (timer_secc <= 10 and "b50000" or inifiles.Render.Color2), timer_min, timer_sec ) or string.format( - "{%s} {%s}%d:%02d", + "{%s}До загрузки {%s}%d:%02d", inifiles.Render.Color1, (timer_secc <= 10 and "b50000" or inifiles.Render.Color2), timer_min, timer_sec )) or - (workload == 1 and string.format("{%s} ", inifiles.Render.Color1) or - string.format("{%s} ", inifiles.Render.Color1))) + (workload == 1 and string.format("{%s}Можно разгружать", inifiles.Render.Color1) or + string.format("{%s}Можно загружать", inifiles.Render.Color1))) if auto then if control then local delta = getMousewheelDelta() @@ -1181,11 +1184,11 @@ function doRenderStats() then if workload == 1 then if unload_location then - local dp = {ls = "sf", sf = "ls"} -- - local dport, ds = string.match(current_warehouse, "(..)(.)") -- + local dp = {ls = "sf", sf = "ls"} -- определить порт + local dport, ds = string.match(current_warehouse, "(..)(.)") -- место загрузки local dcena = (inifiles.tmonitor[dp[dport] .. ds] + inifiles.tmonitor[current_warehouse]) - prices_3dtext[current_warehouse] - -- f= + - 3D + -- цена в другом порту f= цена груза в другом порту + цена в этом порту - цена на 3D тексте этом порту if inifiles.Price.UnLoad ~= 0 then if price_frozen then if tonumber(prices_3dtext[current_warehouse]) == tonumber(inifiles.Price.UnLoad) then @@ -1267,7 +1270,7 @@ function doRenderStats() end end drawClickableText(strok, X, Y) - local stats_array = split(inifiles.Settings.stats_text, '!n!') + local stats_array = split(inifiles.Settings.stats_text,'!n!') local stats_info = { ['!m!'] = string.format('%0.2f mb', (tonumber(gcinfo()) / 1000)), ['!skill!'] = inifiles.Trucker.Skill, @@ -1326,7 +1329,7 @@ end function renderStringMON(X, Y, dist, text1, text2, sendtext1, sendtext2, dist2, text3, text4, sendtext3, sendtext4) if drawClickableText(text1, X, Y) then - sampSendChat( string.format("%s %s .", sendtext1, dist) ) + sampSendChat( string.format("%s %s м.", sendtext1, dist) ) end local x = (X + renderGetFontDrawTextLength(font, text1)) if drawClickableText(text2, x, Y) then @@ -1335,7 +1338,7 @@ function renderStringMON(X, Y, dist, text1, text2, sendtext1, sendtext2, dist2, local x = x + renderGetFontDrawTextLength(font, text2) if drawClickableText(text3, x, Y) then - sampSendChat( string.format("%s %s .", sendtext3, dist2) ) + sampSendChat( string.format("%s %s м.", sendtext3, dist2) ) end if drawClickableText(text4, x + renderGetFontDrawTextLength(font, text3), Y) then sampSendChat( string.format("%s", sendtext4) ) @@ -1362,7 +1365,7 @@ function doRenderMon() stimer = (A2 >= A1 and A1 or A2) local hour, minute, second = stimer / 3600, math.floor(stimer / 60), stimer % 60 send_time_mon = (hour >= 1 and string.format("%02d:%02d:%02d", math.floor(hour), minute - (math.floor(hour) * 60), second) or string.format("%02d:%02d", minute, second)) - rdtext = string.format(". %s", send_time_mon) + rdtext = string.format("Склады. %s", send_time_mon) if drawClickableText(rdtext, X, Y) then transponder_delay = 100 end @@ -1372,12 +1375,12 @@ function doRenderMon() local pX, pY, pZ = getDeadCharCoordinates(PLAYER_PED) local replace_location = { - ["1"] = { " 1", "n1", " 1" }, - ["2"] = { " 2", "n2", " 2" }, - ["1"] = { " 1", "y1", " 1" }, - ["2"] = { " 2", "y2", " 2" }, - ["1"] = { " 1", "l1", " 1" }, - ["2"] = { " 2", "l2", " 2" } + ["Н1"] = { "Нефтезавод №1", "n1", "Нефть 1" }, + ["Н2"] = { "Нефтезавод №2", "n2", "Нефть 2" }, + ["У1"] = { "Склад Угля №1", "y1", "Уголь 1" }, + ["У2"] = { "Склад Угля №2", "y2", "Уголь 2" }, + ["Л1"] = { "Лесопилку №1", "l1", "Лес 1" }, + ["Л2"] = { "Лесопилку №2", "l2", "Лес 2" } } local text_chat = "/jf chat " @@ -1385,15 +1388,15 @@ function doRenderMon() text_chat = "/sms "..pair_mode_id.." " end - local text_render_mon = { "1", "2", "1", "2", "1", "2" } + local text_render_mon = { "Н1", "Н2", "У1", "У2", "Л1", "Л2" } local newX = X Y = Y + height for i = 1, #text_render_mon do local pos = location_pos[replace_location[text_render_mon[i]][3]] local text_render_1 = string.format(" {%s}%s: ", c1, text_render_mon[i]) local text_render_2 = string.format("{%s}%03d", c2, prices_mon[replace_location[text_render_mon[i]][2]]) - local text_send_1 = string.format("%s %s. : %d .", text_chat, replace_location[text_render_mon[i]][1], math.ceil(getDistanceBetweenCoords3d(pX, pY, pZ, pos.x, pos.y, pos.z)) ) - local text_send_2 = string.format("%s %s?", text_chat, replace_location[text_render_mon[i]][1]) + local text_send_1 = string.format("%sЕду на %s. До цели: %d м.", text_chat, replace_location[text_render_mon[i]][1], math.ceil(getDistanceBetweenCoords3d(pX, pY, pZ, pos.x, pos.y, pos.z)) ) + local text_send_2 = string.format("%sКто едет на %s?", text_chat, replace_location[text_render_mon[i]][1]) if drawClickableText(text_render_1, newX, Y) then sampSendChat(text_send_1) @@ -1412,49 +1415,49 @@ function doRenderMon() if control and workload == 1 then if drawClickableText("?", X - renderGetFontDrawTextLength(font, " "), Y) then - sampSendChat(text_chat .. what_is_uploaded[current_load] .. " ?") + sampSendChat(text_chat .. what_is_uploaded[current_load] .. " в ЛС едет?") end end - local string = string.format("{%s} .\n : {%s}%03d {%s}: {%s}%03d {%s}: {%s}%03d", c1, c2, prices_mon.lsn, c1, c2, prices_mon.lsy, c1, c2, prices_mon.lsl) + local string = string.format("{%s}Порт ЛС.\n Н: {%s}%03d {%s}У: {%s}%03d {%s}Л: {%s}%03d", c1, c2, prices_mon.lsn, c1, c2, prices_mon.lsy, c1, c2, prices_mon.lsl) if drawClickableText(string, X, Y) then - local dist = getDistanceBetweenCoords3d(pX, pY, pZ, location_pos[" "].x, location_pos[" "].y, location_pos[" "].z) + local dist = getDistanceBetweenCoords3d(pX, pY, pZ, location_pos["Порт ЛС"].x, location_pos["Порт ЛС"].y, location_pos["Порт ЛС"].z) if workload ~= 0 then - local text = string.format("%s %s . : %0.2d .", text_chat, what_is_uploaded[current_load], dist) + local text = string.format("%sВезу %s в Порт ЛС. До цели: %0.2d м.", text_chat, what_is_uploaded[current_load], dist) sampSendChat(text) else - local text = string.format("%s . : %0.2d .", text_chat, dist) + local text = string.format("%sЕду в Порт ЛС. До цели: %0.2d м.", text_chat, dist) sampSendChat(text) end end Y = Y + (height * 2) if control and workload == 1 then if drawClickableText("?", X - renderGetFontDrawTextLength(font, " "), Y) then - sampSendChat("/jf chat " .. what_is_uploaded[current_load] .. " ?") + sampSendChat("/jf chat " .. what_is_uploaded[current_load] .. " в СФ едет?") end end - local string = string.format("{%s} .\n : {%s}%03d {%s}: {%s}%03d {%s}: {%s}%03d", c1, c2, prices_mon.sfn, c1, c2, prices_mon.sfy, c1, c2, prices_mon.sfl) + local string = string.format("{%s}Порт СФ.\n Н: {%s}%03d {%s}У: {%s}%03d {%s}Л: {%s}%03d", c1, c2, prices_mon.sfn, c1, c2, prices_mon.sfy, c1, c2, prices_mon.sfl) if drawClickableText(string, X, Y) then - local dist = getDistanceBetweenCoords3d(pX, pY, pZ, location_pos[" "].x, location_pos[" "].y, location_pos[" "].z) + local dist = getDistanceBetweenCoords3d(pX, pY, pZ, location_pos["Порт СФ"].x, location_pos["Порт СФ"].y, location_pos["Порт СФ"].z) if workload ~= 0 then - local text = string.format("%s %s . : %0.2d .", text_chat, what_is_uploaded[current_load], dist) + local text = string.format("%sВезу %s в Порт СФ. До цели: %0.2d м.", text_chat, what_is_uploaded[current_load], dist) sampSendChat(text) else - local text = string.format("%s . : %0.2d .", text_chat, dist) + local text = string.format("%sЕду в Порт СФ. До цели: %0.2d м.", text_chat, dist) sampSendChat(text) end end if control then Y = Y + (height * 2) - if drawClickableText("{" .. inifiles.Render.Color2 .. "}[ ]", X, Y) then + if drawClickableText("{" .. inifiles.Render.Color2 .. "}[Смена позиции]", X, Y) then pos[2] = true end Y = Y + height - if drawClickableText("{" .. inifiles.Render.Color2 .. "}[ ]", X, Y) then + if drawClickableText("{" .. inifiles.Render.Color2 .. "}[Отправить в чат]", X, Y) then if (unload_location or load_location) then delay.mon = 1 delay.chatMon = -1 else - SendMonText = string.format("/jf chat [ H:%d :%d :%d] [1 H:%d :%d :%d] [2 H:%d :%d :%d] [C H:%d :%d :%d] [%s]", (prices_mon.lsn / 100), (prices_mon.lsy / 100), (prices_mon.lsl / 100), (prices_mon.n1 / 100), (prices_mon.y1 / 100), (prices_mon.l1 / 100), (prices_mon.n2 / 100), (prices_mon.y2 / 100), (prices_mon.l2 / 100), (prices_mon.sfn / 100), (prices_mon.sfy / 100), (prices_mon.sfl / 100), send_time_mon) + SendMonText = string.format("/jf chat [ЛС H:%d У:%d Л:%d] [1 H:%d У:%d Л:%d] [2 H:%d У:%d Л:%d] [CФ H:%d У:%d Л:%d] [%s]", (prices_mon.lsn / 100), (prices_mon.lsy / 100), (prices_mon.lsl / 100), (prices_mon.n1 / 100), (prices_mon.y1 / 100), (prices_mon.l1 / 100), (prices_mon.n2 / 100), (prices_mon.y2 / 100), (prices_mon.l2 / 100), (prices_mon.sfn / 100), (prices_mon.sfy / 100), (prices_mon.sfl / 100), send_time_mon) sampSendChat(SendMonText) end end @@ -1475,46 +1478,46 @@ function doRenderBind() if script_run and inifiles.Settings.Binder and control or pos[3] then local X, Y = inifiles.Settings.X3, inifiles.Settings.Y3 local plus = (renderGetFontDrawHeight(font) + (renderGetFontDrawHeight(font) / 10)) - if drawClickableText("{" .. inifiles.Render.Color2 .. "}[ ]", X, Y) then + if drawClickableText("{" .. inifiles.Render.Color2 .. "}[Смена позиции]", X, Y) then pos[3] = true end if pair_mode then local color = (binder_mode_sms and "{06940f}" or "{d10000}") - if drawClickableText(color.."[SMS]", X + renderGetFontDrawTextLength(font,"[ ] "), Y) then + if drawClickableText(color.."[SMS]", X + renderGetFontDrawTextLength(font,"[Смена позиции] "), Y) then binder_mode_sms = not binder_mode_sms end end local array = (binder_mode_sms and inifiles.binder_sms or inifiles.binder) for k, string in pairs(array) do old_string = string - if string.find(string, "!") then + if string.find(string, "!НикПары") then local nick = " " if sampIsPlayerConnected(pair_mode_id) then nick = sampGetPlayerNickname(pair_mode_id):gsub("_", " ") end - string = string:gsub("!", nick) + string = string:gsub("!НикПары", nick) end - if string.find(string, "!") then - string = string:gsub("!", pair_mode_id) + if string.find(string, "!ИдПары") then + string = string:gsub("!ИдПары", pair_mode_id) end - if string.find(string, "!") then + if string.find(string, "!КД") then local min, sec = timer_min, timer_sec if min < 0 then min, sec = 0, 0 end - string = string:gsub("!", string.format("%d:%02d", min, sec)) + string = string:gsub("!КД", string.format("%d:%02d", min, sec)) end - if string.find(string, "!") then - string = string:gsub("!", what_is_uploaded[current_load]) + if string.find(string, "!Груз") then + string = string:gsub("!Груз", what_is_uploaded[current_load]) end - if string.find(string, "!") then + if string.find(string, "!Место") then local x, y, z = getCharCoordinates(playerPed) local pos = FindSklad(x, y, z) - string = string:gsub("!", string.format("%s (%s m)", pos.text, math.ceil(pos.dist))) + string = string:gsub("!Место", string.format("%s (%s m)", pos.text, math.ceil(pos.dist))) end Y = Y + plus if drawClickableText(string, X, Y) then sampSendChat(string) end - if drawClickableText("{ff0000}", (X + renderGetFontDrawTextLength(font, string .. " ")), Y) then + if drawClickableText("{ff0000}х", (X + renderGetFontDrawTextLength(font, string .. " ")), Y) then if not binder_mode_sms then table.remove(inifiles.binder, k) else @@ -1528,7 +1531,7 @@ function doRenderBind() end end Y = Y + plus - if drawClickableText("{12a61a} ", X, Y) then + if drawClickableText("{12a61a}Добавить строку", X, Y) then ShowDialog1(7, 1) end end @@ -1574,8 +1577,8 @@ end function LocalBlock(int, param) if int == 1 then - dialogText = ' \n \n \n: '..(inifiles.Settings.blacklist_inversion and ' ' or ' ') - sampShowDialog(222, 'Truck-HUD: [1]', dialogText, '', '', 5) + dialogText = 'Блокировка мониторинга от пользователей\nБлокировка мониторинга с хостинга\nБлокировка мониторинга из чата\nРежим: '..(inifiles.Settings.blacklist_inversion and 'Как белый список' or 'Как черный список') + sampShowDialog(222, 'Truck-HUD: Блокировка [1]', dialogText, 'Выбрать', 'Закрыть', 5) end if int == 2 then dialogFunc = {} @@ -1583,21 +1586,21 @@ function LocalBlock(int, param) for k, v in pairs(base) do if v.tmonitor ~= nil and v.tmonitor.lsn ~= nil then local color = ( inifiles.blacklist[k] == nil and 'FFFFFF' or ( inifiles.blacklist[k] == true and 'fa3620' or 'FFFFFF')) - dialogText = string.format('%s{%s}: %s\t : %s\n', dialogText, color, k, (msk_timestamp - v.tmonitor.time)) + dialogText = string.format('%s{%s}Игрок: %s\tВремя мониторинга: %s\n', dialogText, color, k, (msk_timestamp - v.tmonitor.time)) dialogFunc[#dialogFunc + 1] = function() if inifiles.blacklist[k] == nil then inifiles.blacklist[k] = false end inifiles.blacklist[k] = not inifiles.blacklist[k] end - dialogText = string.format('%s{%s}[ :%s :%s :%s] [1 :%s :%s :%s] [2 :%s :%s :%s] [C :%s :%s :%s\n', dialogText, color, v.tmonitor.lsn, v.tmonitor.lsy,v.tmonitor.lsl,v.tmonitor.n1,v.tmonitor.y1,v.tmonitor.l1,v.tmonitor.n2,v.tmonitor.y2, v.tmonitor.l2, v.tmonitor.sfn,v.tmonitor.sfy,v.tmonitor.sfl) + dialogText = string.format('%s{%s}[ЛС Н:%s У:%s Л:%s] [1 Н:%s У:%s Л:%s] [2 Н:%s У:%s Л:%s] [CФ Н:%s У:%s Л:%s\n', dialogText, color, v.tmonitor.lsn, v.tmonitor.lsy,v.tmonitor.lsl,v.tmonitor.n1,v.tmonitor.y1,v.tmonitor.l1,v.tmonitor.n2,v.tmonitor.y2, v.tmonitor.l2, v.tmonitor.sfn,v.tmonitor.sfy,v.tmonitor.sfl) dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] dialogText = string.format('%s \n', dialogText) dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] end end settings_save() - sampShowDialog(222, 'Truck-HUD: [2]', dialogText, '', '', 2) + sampShowDialog(222, 'Truck-HUD: Блокировка [2]', dialogText, 'Выбрать', 'Назад', 2) end if int == 3 then dialogFunc = {} @@ -1605,21 +1608,21 @@ function LocalBlock(int, param) for k, v in pairs(chat_mon) do if v ~= nil and v.lsn ~= nil then local color = ( inifiles.blacklist[k] == nil and 'FFFFFF' or ( inifiles.blacklist[k] == true and 'fa3620' or 'FFFFFF')) - dialogText = string.format('%s{%s}: %s\t : %s\n', dialogText, color, k, (msk_timestamp - v.time)) + dialogText = string.format('%s{%s}Игрок: %s\tВремя мониторинга: %s\n', dialogText, color, k, (msk_timestamp - v.time)) dialogFunc[#dialogFunc + 1] = function() if inifiles.blacklist[k] == nil then inifiles.blacklist[k] = false end inifiles.blacklist[k] = not inifiles.blacklist[k] end - dialogText = string.format('%s{%s}[ :%s :%s :%s] [1 :%s :%s :%s] [2 :%s :%s :%s] [C :%s :%s :%s\n', dialogText, color, v.lsn, v.lsy,v.lsl,v.n1,v.y1,v.l1,v.n2,v.y2, v.l2, v.sfn,v.sfy,v.sfl) + dialogText = string.format('%s{%s}[ЛС Н:%s У:%s Л:%s] [1 Н:%s У:%s Л:%s] [2 Н:%s У:%s Л:%s] [CФ Н:%s У:%s Л:%s\n', dialogText, color, v.lsn, v.lsy,v.lsl,v.n1,v.y1,v.l1,v.n2,v.y2, v.l2, v.sfn,v.sfy,v.sfl) dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] dialogText = string.format('%s \n', dialogText) dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] end end settings_save() - sampShowDialog(222, 'Truck-HUD: [3]', dialogText, '', '', 2) + sampShowDialog(222, 'Truck-HUD: Блокировка [3]', dialogText, 'Выбрать', 'Назад', 2) end end @@ -1627,7 +1630,7 @@ function ShowStats(int, param) dialogINT = int if int == 1 then dialogKeytoList = { '1' } - dialogText = ' \n' + dialogText = 'Статистика за всё время\n' local array = {} for k,v in pairs(inifiles.log) do local day, month, year = string.match(k, '(%d+)%.(%d+)%.%d%d(%d+)') @@ -1642,13 +1645,13 @@ function ShowStats(int, param) end dialogKeytoList[#dialogKeytoList + 1] = 'nil' dialogKeytoList[#dialogKeytoList + 1] = 'del' - dialogText = string.format('%s\n \n ', dialogText) - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 2) + dialogText = string.format('%s\n \nУдалить всю статистику', dialogText) + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 2) end if int == 2 then dialogKeytoList = { param[1], param[1], param[1] } - dialogText = ': '..param[1]..'\n\n ' - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 5) + dialogText = 'Дата: '..param[1]..'\nСтатистика\nУдалить статистику' + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 5) end if int == 3 then dialogKeytoList = {} @@ -1656,7 +1659,7 @@ function ShowStats(int, param) local v = inifiles.log[param[1]][param[2]] if param[2] == 'day' then dialogKeytoList[1] = param[1] - dialogText = string.format(': %s{FFFFFF}\n:\n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n:\n : %d \n : %d \n : %d ', param[1], + dialogText = string.format('Дата: %s{FFFFFF}\nПодсчет:\n %d фур на сумму %d вирт\n %d загрузок на сумму %d вирт\n %d разгрузок на сумму %d вирт\n %d заправок на сумму %d вирт\n %d починок на сумму %d вирт\n %d канистр на сумму %d вирт\n %d штрафов на сумму %d вирт\nИтоги:\n Зарплата: %d вирт\n Затраты: %d вирт\n Прибыль: %d вирт', param[1], v.arendacount, v.arenda, v.zagruzkacount, v.zagruzka, v.razgruzkacount, v.razgruzka, @@ -1665,11 +1668,11 @@ function ShowStats(int, param) v.kanistrcount, v.kanistr, v.shtrafcount, v.shtraf, v.zp, (v.arenda + v.refill + v.repair + v.kanistr + v.shtraf), v.pribil) - dialogText = string.format('%s\n \n :\n', dialogText, v) + dialogText = string.format('%s\n \n Лог действий:\n', dialogText, v) for k, v in pairs(inifiles.log[param[1]].event) do dialogText = string.format('%s%s\n', dialogText, v) end - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 5) + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 5) else local dd = {} local list = 0 @@ -1684,7 +1687,7 @@ function ShowStats(int, param) list = list -1 end end - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 2) + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 2) end end if int == 4 then @@ -1692,7 +1695,7 @@ function ShowStats(int, param) dialogText = '' local v = inifiles.log[param[1]][param[2]][param[3]] dialogKeytoList[1] = { param[1], param[2] } - dialogText = string.format('{FFFFFF}%02d:00 | %s\n\n:\n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n:\n : %d \n : %d \n : %d ', + dialogText = string.format('{FFFFFF}%02d:00 | %s\n\nПодсчет:\n %d фур на сумму %d вирт\n %d загрузок на сумму %d вирт\n %d разгрузок на сумму %d вирт\n %d заправок на сумму %d вирт\n %d починок на сумму %d вирт\n %d канистр на сумму %d вирт\n %d штрафов на сумму %d вирт\nИтоги:\n Зарплата: %d вирт\n Затраты: %d вирт\n Прибыль: %d вирт', tonumber(param[3]), param[1], v.arendacount, v.arenda, v.zagruzkacount, v.zagruzka, @@ -1702,7 +1705,7 @@ function ShowStats(int, param) v.kanistrcount, v.kanistr, v.shtrafcount, v.shtraf, v.zp, (v.arenda + v.refill + v.repair + v.kanistr + v.shtraf), v.pribil) - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 5) + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 5) end if int == 5 then local all = { @@ -1731,7 +1734,7 @@ function ShowStats(int, param) all[i] = all[i] + s end end - dialogText = string.format(' %d {FFFFFF}\n:\n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n %d %d \n:\n : %d \n : %d \n : %d ', day, + dialogText = string.format('Статистика за %d суток{FFFFFF}\nПодсчет:\n %d фур на сумму %d вирт\n %d загрузок на сумму %d вирт\n %d разгрузок на сумму %d вирт\n %d заправок на сумму %d вирт\n %d починок на сумму %d вирт\n %d канистр на сумму %d вирт\n %d штрафов на сумму %d вирт\nИтоги:\n Зарплата: %d вирт\n Затраты: %d вирт\n Прибыль: %d вирт', day, all.arendacount, all.arenda, all.zagruzkacount, all.zagruzka, all.razgruzkacount, all.razgruzka, @@ -1740,7 +1743,7 @@ function ShowStats(int, param) all.kanistrcount, all.kanistr, all.shtrafcount, all.shtraf, all.zp, (all.arenda + all.refill + all.repair + all.kanistr + all.shtraf), all.pribil) - sampShowDialog(222, 'Truck-HUD: ', dialogText, '', '', 5) + sampShowDialog(222, 'Truck-HUD: Статистика', dialogText, 'Выбрать', 'Назад', 5) end end @@ -1817,167 +1820,167 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) dialogLine[#dialogLine + 1] = (script_run and "TruckHUD\t{59fc30}ON" or "TruckHUD\t{ff0000}OFF") if script_run then - dialogLine[#dialogLine + 1] = " \t" - dialogLine[#dialogLine + 1] = " \t" + dialogLine[#dialogLine + 1] = "Сменить позицию статистики с таймером\t" + dialogLine[#dialogLine + 1] = "Сменить позицию мониторинга цен\t" if inifiles.Settings.Binder then - dialogLine[#dialogLine + 1] = " \t" + dialogLine[#dialogLine + 1] = "Сменить позицию биндера\t" end end dialogLine[#dialogLine + 1] = - " \t" + "Редактировать формат статистики\t" dialogLine[#dialogLine + 1] = "Cruise Control\t" .. (inifiles.Settings.Cruise == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = " HUD\t" .. (inifiles.Settings.pairinfo == true and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Информация о напарнике на HUD\t" .. (inifiles.Settings.pairinfo == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = "\t" .. (inifiles.Settings.Binder == true and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Биндер\t" .. (inifiles.Settings.Binder == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = " > \t" .. (inifiles.Settings.binder_sms_mode == true and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Доклады по клику на цены > в СМС напарнику\t" .. (inifiles.Settings.binder_sms_mode == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = " /\t" .. (auto and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Авто загрузка/разгрузка\t" .. (auto and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " /\t" .. - (inifiles.Settings.AutoOFF == true and "{59fc30}" or "{59fc30}") + "Режим авто загрузки/разгрузки\t" .. + (inifiles.Settings.AutoOFF == true and "{59fc30}Разовая" or "{59fc30}Постоянная") dialogLine[#dialogLine + 1] = - " /\t" .. + "Учитывать КД напарника в режиме авто загрузка/разгрузка\t" .. (inifiles.Settings.auto_load_unload_kd_pair_use == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " -\t" .. (inifiles.Settings.AutoWait == true and "{59fc30}ON" or "{ff0000}OFF") + "Задержка перед авто-загрузкой\t" .. (inifiles.Settings.AutoWait == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.Stop == true and "{59fc30}ON" or "{ff0000}OFF") + "Остановка фуры после разгрузки\t" .. (inifiles.Settings.Stop == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.Report == true and "{59fc30}ON" or "{ff0000}OFF") + "Авто Доклады в рацию\t" .. (inifiles.Settings.Report == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " ?\t" .. (inifiles.Settings.girl == true and "{59fc30}" or "{59fc30}") + "Доклады от?\t" .. (inifiles.Settings.girl == true and "{59fc30}Женщины" or "{59fc30}Мужчины") dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.ChatDoklad and "{59fc30}ON" or "{ff0000}OFF") + "Авто Отправка мониторинга в чат\t" .. (inifiles.Settings.ChatDoklad and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - (pair_mode and " \t{59fc30}" .. pair_mode_name .. "[" .. pair_mode_id .. "]" or - " \t{ff0000}OFF") + (pair_mode and "Режим пары\t{59fc30}" .. pair_mode_name .. "[" .. pair_mode_id .. "]" or + "Режим пары\t{ff0000}OFF") - local text = { "{ff0000}OFF", "{59fc30}", "{59fc30}", "{59fc30}", "{59fc30}" } + local text = { "{ff0000}OFF", "{59fc30}Нефть", "{59fc30}Уголь", "{59fc30}Дерево", "{59fc30}Все" } if text[inifiles.Settings.luCheckerCargo+1] ~= nil then dialogLine[#dialogLine + 1] = - "-\t" .. (text[inifiles.Settings.luCheckerCargo+1]) + "Соло-чекер\t" .. (text[inifiles.Settings.luCheckerCargo+1]) end dialogLine[#dialogLine + 1] = - " SMS ( )\t" .. (inifiles.Settings.SMSpara == true and "{59fc30}ON" or "{ff0000}OFF") + "Авто Доклады в SMS (режим пары)\t" .. (inifiles.Settings.SMSpara == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " ( )\t" .. + "Подсветка напарника в чате (режим пары)\t" .. (inifiles.Settings.LightingPara == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " // \t" .. + "Выделение Портов/Складов/Цен в докладах\t" .. (inifiles.Settings.highlight_jf == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. + "Выделение цены текущего груза в порту\t" .. (inifiles.Settings.LightingPrice == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.ChatOFF == true and "{59fc30}ON" or "{ff0000}OFF") + "Скрывать чат профсоюза\t" .. (inifiles.Settings.ChatOFF == true and "{59fc30}ON" or "{ff0000}OFF") if inifiles.Settings.ChatOFF == false then dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.chat_in_truck == true and "{59fc30}ON" or "{ff0000}OFF") + "Чат профсоюза только в фуре\t" .. (inifiles.Settings.chat_in_truck == true and "{59fc30}ON" or "{ff0000}OFF") end dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.TruckRender == true and "{59fc30}ON" or "{ff0000}OFF") + "Информация на фурах дальнобойщиков\t" .. (inifiles.Settings.TruckRender == true and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. (inifiles.Settings.Tuning == false and "{59fc30}ON" or "{ff0000}OFF") + "Убрать тюнинг колес с фур\t" .. (inifiles.Settings.Tuning == false and "{59fc30}ON" or "{ff0000}OFF") dialogLine[#dialogLine + 1] = - " \t" .. + "Синхронизация с другими пользователями\t" .. (inifiles.Settings.transponder == true and "{59fc30}ON" or "{ff0000}OFF") if inifiles.Settings.transponder then dialogLine[#dialogLine + 1] = - " \t".. + "Карта с позицией напарника\t".. (inifiles.Settings.fastmap == true and "{59fc30}ON" or "{ff0000}OFF") end dialogLine[#dialogLine + 1] = - " \t{" .. inifiles.Settings.ColorPara .. "}" .. inifiles.Settings.ColorPara -- 6 + "Цвет подсветки напарника\t{" .. inifiles.Settings.ColorPara .. "}" .. inifiles.Settings.ColorPara -- 6 dialogTextToList[#dialogLine] = - "{FFFFFF} HEX\n \n /truck url" + "{FFFFFF}Введите новый цвет в HEX\nПодобрать цвет можно через браузер\nЧтобы скопировать ссылку введите /truck url" - dialogLine[#dialogLine + 1] = "\t" .. inifiles.Render.FontName -- 7 - dialogTextToList[#dialogLine] = "{FFFFFF} " + dialogLine[#dialogLine + 1] = "Шрифт\t" .. inifiles.Render.FontName -- 7 + dialogTextToList[#dialogLine] = "{FFFFFF}Введите название шрифта" - dialogLine[#dialogLine + 1] = "\t" .. inifiles.Render.FontSize -- 8 - dialogTextToList[#dialogLine] = "{FFFFFF} " + dialogLine[#dialogLine + 1] = "Размер\t" .. inifiles.Render.FontSize -- 8 + dialogTextToList[#dialogLine] = "{FFFFFF}Введите размер шрифта" - dialogLine[#dialogLine + 1] = "\t" .. inifiles.Render.FontFlag -- 9 + dialogLine[#dialogLine + 1] = "Стиль\t" .. inifiles.Render.FontFlag -- 9 dialogTextToList[#dialogLine] = - "{FFFFFF} .\n\n = 0\n = 1\n() = 2\n = 4\n = 8\n = 16\n = 32\n\n: 13" + "{FFFFFF}Устанавливайте стиль путем сложения.\n\nТекст без особенностей = 0\nЖирный текст = 1\nНаклонность(Курсив) = 2\nОбводка текста = 4\nТень текста = 8\nПодчеркнутый текст = 16\nЗачеркнутый текст = 32\n\nСтандарт: 13" - dialogLine[#dialogLine + 1] = " \t{" .. inifiles.Render.Color1 .. "}" .. inifiles.Render.Color1 -- 10 + dialogLine[#dialogLine + 1] = "Цвет первый\t{" .. inifiles.Render.Color1 .. "}" .. inifiles.Render.Color1 -- 10 dialogTextToList[#dialogLine] = - "{FFFFFF} HEX\n \n /truck url" + "{FFFFFF}Введите новый цвет в HEX\nПодобрать цвет можно через браузер\nЧтобы скопировать ссылку введите /truck url" - dialogLine[#dialogLine + 1] = " \t{" .. inifiles.Render.Color2 .. "}" .. inifiles.Render.Color2 -- 11 + dialogLine[#dialogLine + 1] = "Цвет второй\t{" .. inifiles.Render.Color2 .. "}" .. inifiles.Render.Color2 -- 11 dialogTextToList[#dialogLine] = - "{FFFFFF} HEX\n \n /truck url" + "{FFFFFF}Введите новый цвет в HEX\nПодобрать цвет можно через браузер\nЧтобы скопировать ссылку введите /truck url" - dialogLine[#dialogLine + 1] = " -\t" .. inifiles.Price.Load -- 12 - dialogTextToList[#dialogLine] = "{FFFFFF} -" + dialogLine[#dialogLine + 1] = "Цена авто-загрузки\t" .. inifiles.Price.Load -- 12 + dialogTextToList[#dialogLine] = "{FFFFFF}Введите цену Авто-Загрузки" - dialogLine[#dialogLine + 1] = " -\t" .. inifiles.Price.UnLoad -- 13 - dialogTextToList[#dialogLine] = "{FFFFFF} -" + dialogLine[#dialogLine + 1] = "Цена авто-разгрузки\t" .. inifiles.Price.UnLoad -- 13 + dialogTextToList[#dialogLine] = "{FFFFFF}Введите цену Авто-Разгрузки" - dialogLine[#dialogLine + 1] = " \t" .. inifiles.Settings.Key1:gsub("VK_", "") -- 14 + dialogLine[#dialogLine + 1] = "Кнопка отображения меню\t" .. inifiles.Settings.Key1:gsub("VK_", "") -- 14 - dialogLine[#dialogLine + 1] = " \t" .. inifiles.Settings.Key2:gsub("VK_", "") -- 15 + dialogLine[#dialogLine + 1] = "Кнопка для работы без фуры\t" .. inifiles.Settings.Key2:gsub("VK_", "") -- 15 - dialogLine[#dialogLine + 1] = " \t" .. inifiles.Settings.Key3:gsub("VK_", "") -- 16 + dialogLine[#dialogLine + 1] = "Кнопка для отображения карты\t" .. inifiles.Settings.Key3:gsub("VK_", "") -- 16 - dialogLine[#dialogLine + 1] = " Cruise Control\t" .. inifiles.Settings.Key4:gsub("VK_", "") -- 16 + dialogLine[#dialogLine + 1] = "Кнопка для Cruise Control\t" .. inifiles.Settings.Key4:gsub("VK_", "") -- 16 - dialogLine[#dialogLine + 1] = " " + dialogLine[#dialogLine + 1] = "Локальная блокировка участников" - dialogLine[#dialogLine + 1] = " \t" .. (inifiles.Settings.NewPairMSG == true and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Уведомления когда Вас установили напарником\t" .. (inifiles.Settings.NewPairMSG == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = "- \t" .. (inifiles.Settings.AutoClear == true and "{59fc30}ON" or "{ff0000}OFF") + dialogLine[#dialogLine + 1] = "Авто-Очистка неиспользуемой памяти скрипта\t" .. (inifiles.Settings.AutoClear == true and "{59fc30}ON" or "{ff0000}OFF") - dialogLine[#dialogLine + 1] = " \t" .. string.format('%0.2f MB', (tonumber(gcinfo()) / 1000)) + dialogLine[#dialogLine + 1] = "Очистить неиспользуемую память скрипта\t" .. string.format('%0.2f MB', (tonumber(gcinfo()) / 1000)) - dialogLine[#dialogLine + 1] = " " + dialogLine[#dialogLine + 1] = "Подробная статистика" - dialogLine[#dialogLine + 1] = " " + dialogLine[#dialogLine + 1] = "Контакты автора" - dialogLine[#dialogLine + 1] = " " + dialogLine[#dialogLine + 1] = "Перезагрузка скрипта" local text, list = "", 0 for k, v in pairs(dialogLine) do text = text .. "[" .. list .. "] " .. v .. "\n" list = list + 1 end - sampShowDialog(222, "Truck-HUD: ", text, "", "", 4) + sampShowDialog(222, "Truck-HUD: Настройки", text, "Выбрать", "Закрыть", 4) end if int == 2 then d[7] = true - sampShowDialog(222, "Truck-HUD: ", dtext, "", "", 1) + sampShowDialog(222, "Truck-HUD: Изменение настроек", dtext, "Выбрать", "Назад", 1) end if int == 3 then sampShowDialog( 222, - "Truck-HUD: ", - "{FFFFFF} \t\n Samp-Rp\tSerhiy_Rubin\n {4c75a3}VK{FFFFFF}\tvk.com/id353828351\n {4c75a3}VK{FFFFFF} \tvk.com/club161589495\n{10bef2}Skype{FFFFFF}\tserhiyrubin\n{7289da}Discord{FFFFFF}\tSerhiy_Rubin#3391\n\t#rubin", - "", - "", + "Truck-HUD: Контакты автора", + "{FFFFFF}Выбери что скопировать\t\nНик на Samp-Rp\tSerhiy_Rubin\nСтраничка {4c75a3}VK{FFFFFF}\tvk.com/id353828351\nГруппа {4c75a3}VK{FFFFFF} с модами\tvk.com/club161589495\n{10bef2}Skype{FFFFFF}\tserhiyrubin\n{7289da}Discord{FFFFFF}\tSerhiy_Rubin#3391\nПромокод\t#rubin", + "Копировать", + "Назад", 5 ) end @@ -1991,10 +1994,10 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) if not sampIsDialogActive() then sampShowDialog( 222, - "LUA Truck-HUD: ", - " ", - "", - "", + "LUA Truck-HUD: Смена активации", + "Нажмите на любую клавишу", + "Выбрать", + "Закрыть", 0 ) end @@ -2014,10 +2017,10 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) if int == 7 then sampShowDialog( 222, - "Truck-HUD: ", - "{FFFFFF} \n! - \n! - ID \n! - /\n! - [ ///]\n! - / ", - "", - "", + "Truck-HUD: Биндер", + "{FFFFFF}Поддерживает замены\n!НикПары - Заменится ником напарника\n!ИдПары - Заменится на ID напарника\n!КД - Заменится на время до загрузки/разгрузки\n!Груз - Заменится на [Без груза/Нефть/Уголь/Дерево]\n!Место - Заменится на склад/порт который ближе", + "Сохранить", + "Закрыть", 1 ) @@ -2034,54 +2037,54 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) if int == 8 then sampShowDialog( 222, - "Truck-HUD: ", - "\t{FFFFFF} ID \n SMS /", - "", - "", + "Truck-HUD: Режим пары", + "\t{FFFFFF}Введите ID напарника\nЕму будут отсылаться SMS сообщения о ваших загрузках/разгрузках", + "Выбрать", + "Закрыть", 1 ) end if int == 9 then - setClipboardText(inifiles.Settings.stats_text..'\n\n!n! - \n!mn! - , !n!\n!skill! - \n!skill_poc! - \n!skill_reys! - \n!rang! - \n!rang_poc! - \n!rang_reys! - \n!reys_hour! - \n!reys_day! - \n!zp_hour! - \n!all_zp! - \n!profit_hour! - \n!profit! - ') + setClipboardText(inifiles.Settings.stats_text..'\n\n!n! - Для новой строки\n!mn! - Используется для двойного отступа, после !n!\n!skill! - Скилл\n!skill_poc! - Проценты скилла\n!skill_reys! - Остаток рейсов до нового скилла\n!rang! - Ранг\n!rang_poc! - Проценты ранга\n!rang_reys! - Остаток рейсов для нового ранга\n!reys_hour! - Рейсов в этом часу\n!reys_day! - Рейсов за сутки\n!zp_hour! - Зарплата в этом часу\n!all_zp! - Зарплата за сутки\n!profit_hour! - Прибыль в этом часу\n!profit! - Прибыль за сутки') sampShowDialog( 222, - "Truck-HUD: HUD", - [[{ffffff} HUD - -{ff0000} HUD - -{ff0000} WINDOWS CTRL + V -{ff0000} - C + "Truck-HUD: Редактор HUD", + [[{ffffff}Замены для составления HUD статистики + +{ff0000}ТЕКУЩИЙ ТЕКСТ HUD ПОМЕЩЕН В ВАШ БУФЕР ОБМЕНА +СВЕРНИТЕ ИГРУ +{ff0000}ОТКРОЙТЕ БЛОКНОТ В WINDOWS И ВСТАВЬТЕ ТУДА ТЕКСТ CTRL + V +{ff0000}ПОСЛЕ ВНЕСЕНИЯ ИЗМЕНЕНИЙ СКОПИРУЙТЕ КОД СТАТИСТИКИ +РАЗВЕРНИТЕ ИГРУ И НАЖМИТЕ CОХРАНИТЬ В ДИАЛОГЕ {FFFFFF} - 0 C - - +ЧТОБЫ ВЕРНУТЬ ВСЕ ПО УМОЛЧАНИЮ СКОПИРУЙТЕ ЦИФРУ 0 И НАЖМИТЕ CОХРАНИТЬ +ЕСЛИ КОПИРУЮТСЯ ИЕРОГЛИФЫ ВМЕСТО РУССКИХ БУКВ - ПОВТОРИТЕ ВСЕ ТОЖЕ САМОЕ С РУССКОЙ РАКЛАДКОЙ -!n! - -!mn! - , !n! +!n! - Для новой строки +!mn! - Используется для двойного отступа, после !n! -!skill! - -!skill_poc! - -!skill_reys! - +!skill! - Скилл +!skill_poc! - Проценты скилла +!skill_reys! - Остаток рейсов до нового скилла -!rang! - -!rang_poc! - -!rang_reys! - +!rang! - Ранг +!rang_poc! - Проценты ранга +!rang_reys! - Остаток рейсов для нового ранга -!reys_hour! - -!reys_day! - +!reys_hour! - Рейсов в этом часу +!reys_day! - Рейсов за сутки -!zp_hour! - -!all_zp! - +!zp_hour! - Зарплата в этом часу +!all_zp! - Зарплата за сутки -!zatrat_hour! - -!zatrat_day! - +!zatrat_hour! - Затраты в этом часу +!zatrat_day! - Затраты за сутки -!profit_hour! - -!profit! - ]], - "", - "", +!profit_hour! - Прибыль в этом часу +!profit! - Прибыль за сутки]], + "Сохранить", + "Назад", 0 ) end @@ -2132,8 +2135,8 @@ function loadEvents() end if params:lower() == " cmd" then local text = - " /truck hud\t/ \n /truck auto\t/ Auto-Load/Unload\n /truck chat\t/ \n /truck para\t/ \n /truck menu\t \n /truck play\t \n /truck mon [ID]\t " - sampShowDialog(222, " TruckHUD", text, "", "", 4) + " /truck hud\tВкл/Выкл скрипт\n /truck auto\tВкл/Выкл Auto-Load/Unload\n /truck chat\tВкл/Выкл доклады в рацию\n /truck para\tВкл/Выкл режим пары\n /truck menu\tМеню настроек скрипта\n /truck play\tДополнительное меню управления скриптом\n /truck mon [ID]\tОтправить мониторинг другому игроку в СМС" + sampShowDialog(222, "Команды скрипта TruckHUD", text, "Закрыть", "", 4) return false end if params:lower() == " hud" then @@ -2148,7 +2151,7 @@ function loadEvents() if params:lower() == " chat" then inifiles.Settings.Report = not inifiles.Settings.Report sampAddChatMessage( - string.format(" %s", (inifiles.Settings.Report and "" or "")), + string.format("Авто Доклад в рацию %s", (inifiles.Settings.Report and "активирован" or "деактивирован")), 0xFF2f72f7 ) settings_save() @@ -2170,7 +2173,7 @@ function loadEvents() local id = params:lower():match(" mon (%d+)") return { string.format( - "/sms %s [ H:%d :%d :%d][1 H:%d :%d :%d][2 H:%d :%d :%d][C H:%d :%d :%d]", + "/sms %s [ЛС H:%d У:%d Л:%d][1 H:%d У:%d Л:%d][2 H:%d У:%d Л:%d][CФ H:%d У:%d Л:%d]", id, (prices_mon.lsn / 100), (prices_mon.lsy / 100), @@ -2189,12 +2192,12 @@ function loadEvents() end end if params:lower():find(" server_help") then - sampShowDialog(0, 'TruckHUD: Server Help', [[{FFFFFF} << >> + sampShowDialog(0, 'TruckHUD: Server Help', [[{FFFFFF} << Основные причины проблем соединения с сервером >> - 1. . - - . . + 1. Сервер отключился. Поспрашивайте других дальнобойщиков нет ли у них такой проблемы + Если у всех такая проблема - значит сервер упал. Сообщите в группу разработчику. - 2. . .]], '', '', 0) + 2. У скрипта нет доступа в интернет. Установлен антистиллер.]], 'Закрыть', '', 0) return false end antiflood = os.clock() * 1000 @@ -2208,21 +2211,21 @@ function loadEvents() end function sampev.onServerMessage(color, message) - if message == " !" then + if message == " У вас бан чата!" then delay.chatMon = 0 delay.chat = 0 end - if script_run and string.find(message, " (.+) %. .+") then - local string = string.match(message, " (.+) %. .+") + if script_run and string.find(message, " Вы заработали (.+) вирт%. Деньги будут зачислены на ваш банковский счет в .+") then + local string = string.match(message, " Вы заработали (.+) вирт%. Деньги будут зачислены на ваш банковский счет в .+") inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp = string:find('/') and string:match('(%d+) /') or string if delay.paycheck == 2 then delay.paycheck = 0 return false end end - if string.find(message, " .+<.+>: .+") and not string.find(message, "%->") and inifiles ~= nil then + if string.find(message, " .+<.+>: .+") and not string.find(message, "%->Вопрос") and inifiles ~= nil then if string.find(message, my_nick) then - if string.find(message, " ") then + if string.find(message, "ЛС Н") then delay.chatMon = 0 else delay.chat = 0 @@ -2263,14 +2266,14 @@ function loadEvents() end if result ~= "" then message = message:gsub(result, "{ffffff}"..result..paraColor) - if message:find("( %d+)") then - local text = message:match(" (%d+)") - message = message:gsub(" "..text, " {ffffff}"..text..paraColor) + if message:find("(по %d+)") then + local text = message:match("по (%d+)") + message = message:gsub(" по "..text, " по {ffffff}"..text..paraColor) end - if message:find(" ") then - local text = message:match(" (.+)") + if message:find(" в ") then + local text = message:match(" в (.+)") if text:find(paraColor) then - message = message:gsub(" ", paraColor.." {ffffff}") + message = message:gsub(" в ", paraColor.." в {ffffff}") end end sampAddChatMessage(message, color) @@ -2290,10 +2293,10 @@ function loadEvents() if string.find( message, - " (.*)<(.*)>: %[ :(%d+) :(%d+) :(%d+)%] %[1 :(%d+) :(%d+) :(%d+)%] %[2 :(%d+) :(%d+) :(%d+)%] %[C :(%d+) :(%d+) :(%d+)%]" + " (.*)<(.*)>: %[ЛС Н:(%d+) У:(%d+) Л:(%d+)%] %[1 Н:(%d+) У:(%d+) Л:(%d+)%] %[2 Н:(%d+) У:(%d+) Л:(%d+)%] %[CФ Н:(%d+) У:(%d+) Л:(%d+)%]" ) then - if (string.find(message, "") or string.find(message, "")) then + if (string.find(message, "Купил") or string.find(message, "Продал")) then nick, rank, prices_smon.lsn, @@ -2311,7 +2314,7 @@ function loadEvents() _ = string.match( message, - " (.*)%[.+%]<(.*)>: %[ :(%d+) :(%d+) :(%d+)%] %[1 :(%d+) :(%d+) :(%d+)%] %[2 :(%d+) :(%d+) :(%d+)%] %[C :(%d+) :(%d+) :(%d+)%] %[(.*)%]" + " (.*)%[.+%]<(.*)>: %[ЛС Н:(%d+) У:(%d+) Л:(%d+)%] %[1 Н:(%d+) У:(%d+) Л:(%d+)%] %[2 Н:(%d+) У:(%d+) Л:(%d+)%] %[CФ Н:(%d+) У:(%d+) Л:(%d+)%] %[(.*)%]" ) else nick, @@ -2330,7 +2333,7 @@ function loadEvents() prices_smon.sfl = string.match( message, - " (.*)%[.+%]<(.*)>: %[ :(%d+) :(%d+) :(%d+)%] %[1 :(%d+) :(%d+) :(%d+)%] %[2 :(%d+) :(%d+) :(%d+)%] %[C :(%d+) :(%d+) :(%d+)%]" + " (.*)%[.+%]<(.*)>: %[ЛС Н:(%d+) У:(%d+) Л:(%d+)%] %[1 Н:(%d+) У:(%d+) Л:(%d+)%] %[2 Н:(%d+) У:(%d+) Л:(%d+)%] %[CФ Н:(%d+) У:(%d+) Л:(%d+)%]" ) end chat_mon[nick] = prices_smon @@ -2356,25 +2359,25 @@ function loadEvents() end end - if string.find(message, " : (%d+) / (%d+)") then + if string.find(message, " Нефть: (%d+) / (%d+)") then if current_load ~= 0 then check_noLoad = true end - local S1, S2 = string.match(message, " : (%d+) / (%d+)") + local S1, S2 = string.match(message, " Нефть: (%d+) / (%d+)") if tonumber(S1) ~= 0 then current_load = 1 check_noLoad = false end end - if string.find(message, " : (%d+) / (%d+)") then - local S1, S2 = string.match(message, " : (%d+) / (%d+)") + if string.find(message, " Уголь: (%d+) / (%d+)") then + local S1, S2 = string.match(message, " Уголь: (%d+) / (%d+)") if tonumber(S1) ~= 0 then current_load = 2 check_noLoad = false end end - if string.find(message, " : (%d+) / (%d+)") then - local S1, S2 = string.match(message, " : (%d+) / (%d+)") + if string.find(message, " Дерево: (%d+) / (%d+)") then + local S1, S2 = string.match(message, " Дерево: (%d+) / (%d+)") if tonumber(S1) ~= 0 then current_load = 3 check_noLoad = false @@ -2383,9 +2386,9 @@ function loadEvents() current_load = 0 end end - if string.find(message, " , , . (%d+) ") then + if string.find(message, " Извините, мы вас немного задержим, нужно подготовить груз. Осталось (%d+) секунд") then local S1 = - string.match(message, " , , . (%d+) ") + string.match(message, " Извините, мы вас немного задержим, нужно подготовить груз. Осталось (%d+) секунд") if tonumber(S1) > 3 then delay.load = 0 delay.unload = 0 @@ -2393,13 +2396,13 @@ function loadEvents() end if - message == " " or message == " " or - message == " " or - message == " " or - message == " " or - message == " . " or - message == " , " or - message == " " + message == " У вас недостаточно денег" or message == " Нужно находиться у склада" or + message == " Нужно находиться в порту" or + message == " У вас нет продуктов" or + message == " Вы прибыли без прицепа" or + message == " Вы не в служебной машине. Нужно быть водителем" or + message == " Вы должны находиться в порту, или на складе" or + message == " Вы должны устроиться на работу дальнобойщика" then delay.mon, delay.chatMon = 0, 0 delay.load = 0 @@ -2408,13 +2411,13 @@ function loadEvents() auto = false autoh = true menu[2].run = false - message = message..". TruckHUD !" + message = message..". Режим АВТО TruckHUD выключен!" return { color, message } end end -- /truck load unload error - if message == " !" or message == " : /r /f [text]" then + if message == " Вам не доступен этот чат!" or message == " Введите: /r или /f [text]" then delay.chat = 0 delay.chatMon = 0 end -- /jf chat error @@ -2426,23 +2429,23 @@ function loadEvents() end -- Log update if - message == " " or message == " " or - message == " : /sms [playerid / phonenumber] []" or - message == " " + message == " Сообщение доставлено" or message == " Игрок оффлайн" or + message == " Введите: /sms [playerid / phonenumber] [текст]" or + message == " Телефон вне зоны доступа сети" then delay.sms = 0 end - if string.find(message, " %d+ , (%d+) . : %d+ ") and isTruckCar() then + if string.find(message, "Загружено %d+ груза, на сумму (%d+) вирт. Скидка: %d+ вирт") and isTruckCar() then timer = msk_timestamp - local Z1, Z2, Z3 = string.match(message, " (%d+) , (%d+) . : (%d+) ") + local Z1, Z2, Z3 = string.match(message, " Загружено (%d+) груза, на сумму (%d+) вирт. Скидка: (%d+) вирт") gruzLOAD = Z1 if texts_of_reports[current_warehouse] ~= nil then local cena = (Z2 + Z3) / (Z1 / 1000) local sklad = texts_of_reports[current_warehouse] local modelId = getCharModel(PLAYER_PED) report_text = - (not inifiles.Settings.girl and "" or "") .. " " .. sklad .. " " .. cena + (not inifiles.Settings.girl and "Загрузился" or "Загрузилась") .. " на " .. sklad .. " по " .. cena sms_pair_mode = report_text if inifiles.Settings.Report then delay.chat = 1 @@ -2466,16 +2469,16 @@ function loadEvents() end end - if string.find(message, " (%d+) , (%d+) ") and isTruckCar() then + if string.find(message, "Вы заработали (%d+) вирт, из которых (%d+) вирт будет добавлено к вашей зарплате") and isTruckCar() then pttModule() timer = msk_timestamp local Z1, Z2 = - string.match(message, " (%d+) , (%d+) ") + string.match(message, " Вы заработали (%d+) вирт, из которых (%d+) вирт будет добавлено к вашей зарплате") if texts_of_reports[current_warehouse] ~= nil and gruzLOAD ~= nil then local cena = Z1 / (gruzLOAD / 1000) local sklad = texts_of_reports[current_warehouse] local modelId = getCharModel(PLAYER_PED) - report_text = "" .. (not inifiles.Settings.girl and " " or " ") .. sklad .. " " .. cena + report_text = "Разгрузил" .. (not inifiles.Settings.girl and " " or "а ") .. sklad .. " по " .. cena sms_pair_mode = report_text if inifiles.Settings.Report then delay.chat = 1 @@ -2510,7 +2513,7 @@ function loadEvents() end delay.paycheck = 1 end - if message == " !" then + if message == " Не флуди!" then if delay.skill == 2 then delay.skill = 1 end @@ -2533,41 +2536,44 @@ function loadEvents() delay.dir = 1 end end - if message == " !" then + if message == " У вас нет телефонного справочника!" then delay.dir = 0 end - if string.find(message, " ") and isTruckCar() then + if string.find(message, " Вы арендовали транспортное средство") and isTruckCar() then local message = sampGetDialogText() - if string.find(message, "") then - local Z1 = string.match(message, " : {FFFF00}(%d+) ") + if string.find(message, "Стоимость") then + local Z1 = string.match(message, "Стоимость аренды: {FFFF00}(%d+) вирт") write_table_log('arenda', {Z1}, 3) end end - if string.find(message, " (%d+) , (%g+)") then - local Z1, Z2 = string.match(message, " (%d+) , (%g+)") + if string.find(message, " Вы заплатили штраф (%d+) вирт, Офицеру (%g+)") then + local Z1, Z2 = string.match(message, " Вы заплатили штраф (%d+) вирт, Офицеру (%g+)") write_table_log('shtraf', {Z1, message}, 4) end - if string.find(message, " %(%) (%d+) , (%g+)") and isTruckCar() then - local Z1, Z2 = string.match(message, " %(%) (%d+) , (%g+)") + if string.find(message, " Вашу машину отремонтировал%(а%) за (%d+) вирт, Механик (%g+)") and isTruckCar() then + local Z1, Z2 = string.match(message, " Вашу машину отремонтировал%(а%) за (%d+) вирт, Механик (%g+)") write_table_log('repair', {Z1}, 5) end - if string.find(message, " (%g+) 300 (%d+) ") and isTruckCar() then - local Z1, Z2 = string.match(message, " (%g+) 300 (%d+) ") + if string.find(message, " Автомеханик (%g+) заправил ваш автомобиль на 300 за (%d+) вирт") and isTruckCar() then + local Z1, Z2 = string.match(message, " Автомеханик (%g+) заправил ваш автомобиль на 300 за (%d+) вирт") write_table_log('refill', {Z2}, 6) end - if string.find(message, " , : (%d+) ") and isTruckCar() then - local Z1 = string.match(message, " , : (%d+) ") + if string.find(message, " Машина заправлена, за: (%d+) вирт") and isTruckCar() then + local Z1 = string.match(message, " Машина заправлена, за: (%d+) вирт") write_table_log('refill', {Z1}, 7) end - if string.find(message, " 50 (%d+) ") and isTruckCar() then - local Z1 = string.match(message, " 50 (%d+) ") + if string.find(message, " Вы купили канистру с 50 литрами бензина за (%d+) вирт") and isTruckCar() then + local Z1 = string.match(message, " Вы купили канистру с 50 литрами бензина за (%d+) вирт") write_table_log('kanistr', {Z1}, 8) end end function sampev.onShowDialog(DdialogId, Dstyle, Dtitle, Dbutton1, Dbutton2, Dtext) - if Dstyle == 0 and string.find(Dtext, "{00AB06}{CECECE}") and string.find(Dtext, "{00AB06}{CECECE}") then - local Skill, SkillP, Rank, RankP = string.match( Dtext, ".+{00AB06}{CECECE}.*: (%d+)\t: .+ (%d+%.%d+)%%.*{CECECE}: (%d+) \t: .+ (%d+%.%d+)%%") + -- Dtext = u8:encode(Dtext) + -- Dtitle = u8:encode(Dtitle) + addChatMessage(Dtitle) + if Dstyle == 0 and string.find(Dtext, "{00AB06}Дальнобойщик{CECECE}") and string.find(Dtext, "{00AB06}Механик{CECECE}") then + local Skill, SkillP, Rank, RankP = string.match( Dtext, ".+{00AB06}Дальнобойщик{CECECE}.*Скилл: (%d+)\tОпыт: .+ (%d+%.%d+)%%.*{CECECE}Ранг: (%d+) \tОпыт: .+ (%d+%.%d+)%%") if Skill ~= nil then SkillP = tonumber(SkillP) RankP = tonumber(RankP) @@ -2596,11 +2602,11 @@ function loadEvents() end end - if DdialogId == 22 and Dstyle == 0 and string.find(Dtext, "") then + if DdialogId == 22 and Dstyle == 0 and string.find(Dtext, "Заводы") then delay.mon = 0 mon_life = msk_timestamp mon_time = msk_timestamp - prices_mon.n1, prices_mon.n2, prices_mon.y1, prices_mon.y2, prices_mon.l1, prices_mon.l2, prices_mon.lsn, prices_mon.lsy, prices_mon.lsl, prices_mon.sfn, prices_mon.sfy, prices_mon.sfl = string.match( Dtext, "[].* 1.*.*: 0.(%d+) .* 2.*.*: 0.(%d+) .* 1.*.*: 0.(%d+) .* 2.*.*: 0.(%d+) .* 1.*.*: 0.(%d+) .* 2.*.*: 0.(%d+) .*[].* .*.*: 0.(%d+) .*.*: 0.(%d+) .*.*: 0.(%d+) .* .*.*: 0.(%d+) .*.*: 0.(%d+) .*.*: 0.(%d+) " ) + prices_mon.n1, prices_mon.n2, prices_mon.y1, prices_mon.y2, prices_mon.l1, prices_mon.l2, prices_mon.lsn, prices_mon.lsy, prices_mon.lsl, prices_mon.sfn, prices_mon.sfy, prices_mon.sfl = string.match( Dtext, "[Заводы].*Нефтезавод №1.*.*Нефть: 0.(%d+) вирт.*Нефтезавод №2.*.*Нефть: 0.(%d+) вирт.*Склад угля №1.*.*Уголь: 0.(%d+) вирт.*Склад угля №2.*.*Уголь: 0.(%d+) вирт.*Лесопилка №1.*.*Дерево: 0.(%d+) вирт.*Лесопилка №2.*.*Дерево: 0.(%d+) вирт.*[Порты].*Порт ЛС.*.*Нефть: 0.(%d+) вирт.*.*Уголь: 0.(%d+) вирт.*.*Дерево: 0.(%d+) вирт.*Порт СФ.*.*Нефть: 0.(%d+) вирт.*.*Уголь: 0.(%d+) вирт.*.*Дерево: 0.(%d+) вирт" ) for k, v in pairs(prices_mon) do if string.find(tostring(prices_mon[k]), "99") then @@ -2628,7 +2634,7 @@ function loadEvents() if delay.chatMon == -1 then SendMonText = string.format( - "[ :%d :%d :%d] [1 :%d :%d :%d] [2 :%d :%d :%d] [C :%d :%d :%d]", + "[ЛС Н:%d У:%d Л:%d] [1 Н:%d У:%d Л:%d] [2 Н:%d У:%d Л:%d] [CФ Н:%d У:%d Л:%d]", (prices_mon.lsn / 100), (prices_mon.lsy / 100), (prices_mon.lsl / 100), @@ -2651,27 +2657,27 @@ function loadEvents() end if delay.dir ~= 0 then - if string.find(Dtitle, ".") and delay.dir == 2 then + if string.find(Dtitle, "Тел.справочник") and delay.dir == 2 then sampSendDialogResponse(DdialogId, 1, 1, "") delay.dir = 3 return false end - if string.find(Dtitle, "") and delay.dir == 3 then + if string.find(Dtitle, "Работы") and delay.dir == 3 then lua_thread.create( function() repeat wait(0) until delay.dir == 4 wait(150) - sampSendDialogResponse(DdialogId, 1, 9, "[9] ") + sampSendDialogResponse(DdialogId, 1, 9, "[9] Дальнобойщик") end ) delay.dir = 4 return false end - if string.find(Dtitle, "") and string.find(Dtext, "AFK ") and delay.dir == 4 then + if string.find(Dtitle, "Меню") and string.find(Dtext, "AFK секунд") and delay.dir == 4 then delay.dir = 0 sampShowDialog(222, Dtitle, Dtext, Dbutton1, Dbutton2, Dstyle) return false @@ -2689,7 +2695,7 @@ function loadEvents() wait_auto = msk_timestamp end id_3D_text = id - if text:find("") then + if text:find("Порт") then unload_location = true local one_plus = function(price) for i = 1, #price do @@ -2701,14 +2707,14 @@ function loadEvents() end local cargoN, cargoY, cargoL = string.match(text, v) cargoN, cargoY, cargoL = one_plus({cargoN, cargoY, cargoL}) - luChecker.set3Dtext("", {prices_3dtext[k .. "n"], prices_3dtext[k .. "y"], prices_3dtext[k .. "l"]}, {cargoN, cargoY, cargoL}, position) + luChecker.set3Dtext("Порт", {prices_3dtext[k .. "n"], prices_3dtext[k .. "y"], prices_3dtext[k .. "l"]}, {cargoN, cargoY, cargoL}, position) prices_3dtext[k .. "n"], prices_3dtext[k .. "y"], prices_3dtext[k .. "l"] = cargoN, cargoY, cargoL prices_3dtext_id[k .. "n"], prices_3dtext_id[k .. "y"], prices_3dtext_id[k .. "l"] = id, id, id prices_3dtext_pos[k .. "n"], prices_3dtext_pos[k .. "y"], prices_3dtext_pos[k .. "l"] = position, position, position - local port = (text:find("") and "" or "") + local port = (text:find("ЛС") and "ЛС" or "СФ") local ctext = string.format( - " %s\n: 0.%s\n: 0.%s\n: 0.%s ", + "Порт %s\nНефть: 0.%s\nУголь: 0.%s\nДерево: 0.%s ", port, prices_3dtext[k .. "n"], prices_3dtext[k .. "y"], @@ -2722,13 +2728,13 @@ function loadEvents() until sampIs3dTextDefined(id) if inifiles.Settings.LightingPrice then if current_load == 1 then - ctext = ctext:gsub(":", "{FFFFFF}:") - ctext = ctext:gsub(":", "{FFFF00}:") + ctext = ctext:gsub("Нефть:", "{FFFFFF}Нефть:") + ctext = ctext:gsub("Уголь:", "{FFFF00}Уголь:") elseif current_load == 2 then - ctext = ctext:gsub(":", "{FFFFFF}:") - ctext = ctext:gsub(":", "{FFFF00}:") + ctext = ctext:gsub("Уголь:", "{FFFFFF}Уголь:") + ctext = ctext:gsub("Дерево:", "{FFFF00}Дерево:") elseif current_load == 3 then - ctext = ctext:gsub(":", "{FFFFFF}:") + ctext = ctext:gsub("Дерево:", "{FFFFFF}Дерево:") end end sampCreate3dTextEx( @@ -2745,7 +2751,7 @@ function loadEvents() ) else local cargo_save = string.match(text, v) - luChecker.set3Dtext("", {prices_3dtext[k], k}, {cargo_save, k}, position) + luChecker.set3Dtext("Склад", {prices_3dtext[k], k}, {cargo_save, k}, position) prices_3dtext[k] = cargo_save prices_3dtext_id[k] = id prices_3dtext_pos[k] = position @@ -2783,8 +2789,11 @@ function loadEvents() end end, Cid) end + utf8_function({ + { "sampev", "onShowDialog" }, + { "sampev", "onServerMessage" }, + }, AnsiToUtf8, AnsiToUtf8) end - function isTruck3dTextDefined(id) local result = false local delete = {} @@ -2851,14 +2860,14 @@ function write_table_log(key, param, Log) end local text_to_log = { - [1] = { string.format(' %s$ %s', param[1], (inifiles.Trucker.MaxZP < tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) and ' [ ]' or '') )}, - [2] = { string.format(' %s$ | %s$ %s', param[1], param[2], (inifiles.Trucker.MaxZP < tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) and ' [ ]' or '')) }, - [3] = { string.format(' %s$', param[1]) }, - [4] = { string.format(' %s$ %s', param[1], param[2]) }, - [5] = { string.format(' %s$', param[1]) }, - [6] = { string.format(' %s$', param[1]) }, - [7] = { string.format(' %s$', param[1]) }, - [8] = { string.format(' %s$', param[1]) }, + [1] = { string.format('Загрузка за %s$ %s', param[1], (inifiles.Trucker.MaxZP < tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) and ' [Достигнут лимит зарплаты]' or '') )}, + [2] = { string.format('Разгрузка за %s$ | Заработано %s$ %s', param[1], param[2], (inifiles.Trucker.MaxZP < tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) and ' [Достигнут лимит зарплаты]' or '')) }, + [3] = { string.format('Аренда фуры за %s$', param[1]) }, + [4] = { string.format('Штраф %s$ офицеру %s', param[1], param[2]) }, + [5] = { string.format('Починка фуры за %s$', param[1]) }, + [6] = { string.format('Заправка фуры за %s$', param[1]) }, + [7] = { string.format('Заправка фуры за %s$', param[1]) }, + [8] = { string.format('Покупка канистры за %s$', param[1]) }, [9] = { string.format('PayDay') } } for k, v in pairs(text_to_log[Log]) do @@ -3199,7 +3208,7 @@ function doPair_G() error_message(1, '') para_message_send = nil pair_mode_name = sampGetPlayerNickname(pair_mode_id) - menu[4][1] = "SMS " .. pair_mode_name .. "[" .. pair_mode_id .. "]" + menu[4][1] = "SMS » " .. pair_mode_name .. "[" .. pair_mode_id .. "]" pair_mode = true menu[4].run = true transponder_delay = 100 @@ -3207,7 +3216,7 @@ function doPair_G() pair_mode_id = -1 pair_mode = false menu[4].run = false - sampAddChatMessage("! ID .", -1) + sampAddChatMessage("Ошибка! Игрок под этим ID не в сети.", -1) end pair_yes = nil end @@ -3251,7 +3260,7 @@ function transponder() local result, myid = sampGetPlayerIdByCharHandle(PLAYER_PED) local myname = sampGetPlayerNickname(myid) - if (os.time() - afk_solo_message_false < 7 or os.time() - live > 7) or (solo_message_send.time ~= 0 and os.time() - solo_message_send.time > 5) then -- + if (os.time() - afk_solo_message_false < 7 or os.time() - live > 7) or (solo_message_send.time ~= 0 and os.time() - solo_message_send.time > 5) then -- Очистить если данные устарели clearSoloMessage() end @@ -3318,11 +3327,11 @@ function transponder() info = decodeJson(fileText) end, function(e) sampfuncsLog(fileText) - sampAddChatMessage("[TruckHUD]: !",-1) + sampAddChatMessage("[TruckHUD]: Ошибочный ответ сервера!",-1) info = nil end) if info == nil then - print("{ff0000}[" .. string.upper(thisScript().name) .. "]: .") + print("{ff0000}[" .. string.upper(thisScript().name) .. "]: Был получен некорректный ответ от сервера.") else if download_call == 0 then if request_table["info"]["solo_message"]["name"] == solo_message_send.name then @@ -3337,16 +3346,16 @@ function transponder() base = info.base error_message('2', '') local minKD = 1000000 - local dialogText = '[ID]\t\t/\t\n' + local dialogText = 'Имя[ID]\tСкилл\tФура/Груз\tНапарник\n' local tmonitor = {} for k,v in pairs(base) do if v.pair_mode_name == myname then if new_pair[k] == nil then if sampIsPlayerConnected(v.id) and sampGetPlayerNickname(v.id) == k then new_pair[k] = true - sampAddChatMessage('TruckHUD: '..k..'['..v.id..'] .', -1) + sampAddChatMessage('TruckHUD: Игрок '..k..'['..v.id..'] добавил Вас в режим пары.', -1) if pair_mode_id ~= v.id then - sampAddChatMessage('TruckHUD: {e63939}"G"{FFFFFF} .', -1) + sampAddChatMessage('TruckHUD: Нажмите {e63939}"G"{FFFFFF} чтобы принять его в напарники.', -1) pair_yes = { time = os.time(), id = v.id @@ -3356,7 +3365,7 @@ function transponder() end end if new_pair[k] ~= nil and v.pair_mode_name ~= myname then - sampAddChatMessage('TruckHUD: '..k..'['..v.id..'] .', -1) + sampAddChatMessage('TruckHUD: Игрок '..k..'['..v.id..'] убрал Вас из режима пары.', -1) new_pair[k] = nil end if inifiles.blacklist[k] == nil then @@ -3395,21 +3404,21 @@ function transponder() pair_status = 200 if para_message_send == nil then para_message_send = 1 - sampAddChatMessage(" "..pair_mode_name.."["..pair_mode_id.."]"..". .", -1) - sampAddChatMessage(string.format(" : %s. : %s + %s.", inifiles.Settings.Key3:gsub("VK_", ""), inifiles.Settings.Key3:gsub("VK_", ""), inifiles.Settings.Key2:gsub("VK_", "")), -1) + sampAddChatMessage("Установлен напарник "..pair_mode_name.."["..pair_mode_id.."]"..". Теперь вы можете пользоваться картой.", -1) + sampAddChatMessage(string.format("Активация в фуре: %s. Без фуры: %s + %s.", inifiles.Settings.Key3:gsub("VK_", ""), inifiles.Settings.Key3:gsub("VK_", ""), inifiles.Settings.Key2:gsub("VK_", "")), -1) end elseif info.result == "error" then if info.reason ~= nil then if info.reason == 403 then error_message('2', '') pair_status = info.reason - error_message('1', pair_mode_name.."["..pair_mode_id.."] TruckHUD.") + error_message('1', pair_mode_name.."["..pair_mode_id.."] пока не установил Вас напарником в своем TruckHUD.") elseif info.reason == 404 then error_message('2', '') pair_status = info.reason - error_message('1', pair_mode_name.."["..pair_mode_id.."] TruckHUD") + error_message('1', pair_mode_name.."["..pair_mode_id.."] не найден в базе игроков TruckHUD") elseif info.reason == 425 then - error_message('2', ' . vk.com/rubin.mods') + error_message('2', 'Слишком частые запросы на хостинг. Разберитесь с этим или обратитесь за помощью в группу vk.com/rubin.mods') end end end @@ -3423,7 +3432,7 @@ function transponder() f = nil end else - error_message('2', ' . /truck server_help vk.com/rubin.mods.') + error_message('2', 'Не получил ответа от хостинга. Найдите причину с помощью /truck server_help или напишите о проблеме в группу vk.com/rubin.mods.') end if doesFileExist(response_path) then os.remove(response_path) @@ -3452,14 +3461,14 @@ function transponder_solo_message(info) if solo_data_antiflood[sender] == nil then solo_data_antiflood[sender] = {} end - local result_find = false -- + local result_find = false -- Отклонить показ сообщения local check_label = { "id", "name", "action", "cargo" } local cargo_symbol = (inifiles.Settings.luCheckerCargo == 1 and "n" or (inifiles.Settings.luCheckerCargo == 2 and "y" or (inifiles.Settings.luCheckerCargo == 3 and "l" or ""))) if cargo_symbol ~= "" or inifiles.Settings.luCheckerCargo == 4 then if (solo_data["cargo"]:find(cargo_symbol) and fix_l(cargo_symbol, solo_data["cargo"])) or inifiles.Settings.luCheckerCargo == 4 then - for i = 1, #solo_data_antiflood[sender] do -- + for i = 1, #solo_data_antiflood[sender] do -- Поиск дубликата local counter = 0 for s = 1, #check_label do if solo_data[s] == solo_data_antiflood[sender][i][s] then @@ -3482,8 +3491,8 @@ function transponder_solo_message(info) end if not result_find then if texts_of_reports[solo_data["cargo"]] ~= nil then - local text1 = string.format("%s[%s] %s %s.", solo_data.name, solo_data.id, (solo_data.action == "load" and " " or ""), texts_of_reports[solo_data["cargo"]]) - local text = string.format("%s : %s", text1, sender) + local text1 = string.format("%s[%s] %s %s.", solo_data.name, solo_data.id, (solo_data.action == "load" and "загрузился на" or "разгрузил"), texts_of_reports[solo_data["cargo"]]) + local text = string.format("%s Отправил: %s", text1, sender) if solo_antiflood_message[text1] == nil or (os.time() - solo_antiflood_message[text1] > 3) then solo_antiflood_message[text1] = os.time() addChatMessage(text) @@ -3509,7 +3518,7 @@ function error_message(key, text) else if error_array[key] ~= nil then if key == '2' or key == '3' then - sampAddChatMessage(' TruckHUD .', -1) + sampAddChatMessage('Связь с сервером TruckHUD возобновлена.', -1) end error_array[key] = nil end @@ -3519,13 +3528,13 @@ end function count_next() local count = (transponder_delay - (os.clock() * 1000 - delay_start * 1000)) / 1000 if count >= 0 then - return string.format("%0.3f", count) + return string.format("%0.3fс", count) elseif wait_for_response then - return " " -- WAITING FOR RESPONSE + return "Ожидание ответа" -- WAITING FOR RESPONSE elseif processing_response then - return " " -- PROCESSING RESPONSE + return "Обработка ответа" -- PROCESSING RESPONSE else - return " " -- PERFOMING REQUEST + return "Выполнение запроса" -- PERFOMING REQUEST end end @@ -3668,20 +3677,20 @@ function get_time() os.remove(adress) else msk_timestamp = os.time() - sampAddChatMessage('TruckHUD: . .', -1) + sampAddChatMessage('TruckHUD: Ошибка получения точного времени. Используется локальное.', -1) end end end if status == 58 then if msk_timestamp == 0 then msk_timestamp = os.time() - sampAddChatMessage('TruckHUD: . .', -1) + sampAddChatMessage('TruckHUD: Ошибка получения точного времени. Используется локальное.', -1) end end end) else msk_timestamp = os.time() - sampAddChatMessage('TruckHUD: . .', -1) + sampAddChatMessage('TruckHUD: Ошибка получения точного времени. Используется локальное.', -1) end repeat wait(0) until msk_timestamp > 0 @@ -3707,7 +3716,7 @@ function split(str, delim, plain) end function showTruckers() - local dialogText = '[ID] AFK\t / \t / \t\n' + local dialogText = 'Имя[ID] AFK\tСкилл / Ранг\tФура / Груз\tНапарник\n' local trucker_count = 0 local _, myid = sampGetPlayerIdByCharHandle(PLAYER_PED) @@ -3716,11 +3725,11 @@ function showTruckers() if (sampIsPlayerConnected(v.id) or myid == v.id) and sampGetPlayerNickname(v.id) == k then trucker_count = trucker_count + 1 local afk = math.ceil(msk_timestamp - v.timestamp) - dialogText = string.format('%s%s[%s] %s\t%s / %s\t%s\t%s\n', dialogText, k, v.id, (afk > 10 and '[AFK: '..afk..']' or ''), v.skill, v.rank, ( (v.is_truck and ' ' or ' ')..(v.gruz == 0 and '/ ' or (v.gruz == 1 and '/ ' or (v.gruz == 2 and '/ ' or (v.gruz == 3 and '/ ' or '/ ')))) ), ( v.pair_mode_name == '____' and '' or v.pair_mode_name..'['..v.paraid..']')) + dialogText = string.format('%s%s[%s] %s\t%s / %s\t%s\t%s\n', dialogText, k, v.id, (afk > 10 and '[AFK: '..afk..']' or ''), v.skill, v.rank, ( (v.is_truck and 'Да ' or 'Нет ')..(v.gruz == 0 and '/ Нет' or (v.gruz == 1 and '/ Нефть' or (v.gruz == 2 and '/ Уголь' or (v.gruz == 3 and '/ Дерево' or '/ Нет')))) ), ( v.pair_mode_name == '____' and 'Нет' or v.pair_mode_name..'['..v.paraid..']')) end end end - sampShowDialog(0, ' : '..trucker_count, (#dialogText == 0 and ' ' or dialogText), '', '', 5) + sampShowDialog(0, 'Дальнобойщики со скриптом в сети: '..trucker_count, (#dialogText == 0 and 'Список пуст' or dialogText), 'Выбрать', 'Закрыть', 5) end function renderTruckers() @@ -3751,10 +3760,10 @@ function renderTruckers() string.format('{%s}<< {%s}0:00 {%s}>>', inifiles.Render.Color1, inifiles.Render.Color2, inifiles.Render.Color1) ) local gruz_player = string.format('{%s}%s', inifiles.Render.Color2, - (base[nickname].gruz == 0 and ' ' or (base[nickname].gruz == 1 and '' or (base[nickname].gruz == 2 and '' or (base[nickname].gruz == 3 and '' or '')))) + (base[nickname].gruz == 0 and 'Нет груза' or (base[nickname].gruz == 1 and 'Нефть' or (base[nickname].gruz == 2 and 'Уголь' or (base[nickname].gruz == 3 and 'Дерево' or 'Нет')))) ) local para_player = string.format('{%s}%s', inifiles.Render.Color2, - (base[nickname].pair_mode_name ~= '____' and base[nickname].pair_mode_name..'['..base[nickname].paraid..']' or ' ') + (base[nickname].pair_mode_name ~= '____' and base[nickname].pair_mode_name..'['..base[nickname].paraid..']' or 'Нет напарника') ) local pair_kd = '' if base[nickname].pair_mode_name ~= '____' and base[base[nickname].pair_mode_name] ~= nil then @@ -3820,38 +3829,38 @@ function loadPtt() skins = { 63, 64, 85, 87, 152, 178, 207, 237, 238, 243, 244, 245, 246, 256, 257 }, names = { "Rachel", "Sara", "Cindy", "Clover", "Cleo", "Lisa", "Melissa", "Jessica", "Samantha", "Susan", "Rose", "April", "Ashley", "Amelia", "Emily", "Angela", "Annabel", "Abby", "Abigail", "Elise", "Milly", "Stacey", "Gloria", "Courtney", "Patricia", "Penelope" }, message = { - " ", - " ? ", - " , ", - " ", - " 3 , ", - " , !", - " , ", - " , ", - " ?", - " , ", - " , ", - " ?", - " ?" + "А вот и король дорог приехал", + "Разгрузил тележку? Потанцуй со мной", + "От тебя воняет бензином, фии", + "Руками не трогать", + "Отойди на 3 метра, противный", + "Иди ко мне, мой тигр!", + "Я сейчас тебе покажу такое, чего ты никогда не видел в жизни", + "Ну иди сюда, ты заслужил", + "Хочешь поразвлекаться?", + "Я могу поднять твое настроение, если ты понимаешь о чем я", + "Первый час бесплатно, за второй ты еще не отработал", + "Хочеть выпить кофе со мной?", + "К тебе или ко мне?" } }, -- shluxi [2] = { skins = { 10, 39, 53, 54, 75, 77, 88, 89, 129, 130, 196, 197, 199, 218, 231, 232 }, names = { "Rachel", "Sara", "Cindy", "Clover", "Cleo", "Lisa", "Melissa", "Jessica", "Samantha", "Susan", "Rose", "April", "Ashley", "Amelia", "Emily", "Angela", "Annabel", "Abby", "Abigail", "Elise", "Milly", "Stacey", "Gloria", "Courtney", "Patricia", "Penelope" }, message = { - ", ", - " ", - " , ", - " ", - " , ? ?", - " , !", - " , , ", - " , ", - " \" 45 - \"", - " ", - " , ", - " , ", - " , " + "Ээх, встряхнем стариной", + "Давай танцуй внучок", + "Деньги только крупными купюрами, все таки пенсия понимаешь", + "Бутылочку от пива не выбрасывай", + "И что как работа, внучок? Платят хоть?", + "Иди ко мне, мой тигр!", + "Иди сюда, мой милый, не бойся", + "До тебя пол страны обслужила, а все такая же красивая", + "Как говорится \"В 45 - баба ягодка опять\"", + "Можешь оплатить пустыми банками", + "Ты прям как мой внучек, такой же стеснительный", + "Трахни меня, я тебе заплачу", + "Да ты не пугайся, я просто не накрашена" } }, -- bomjixi [3] = { @@ -3867,16 +3876,16 @@ function loadPtt() { "FREEWEIGHTS", "GYM_FREE_CELEBRATE" } }, message = { - " , ", - " ", - " ", - "!", - ", ?", - " , ", - " -? ", - " ?", - " ? ?", - " , " + "Ну ты и долгий, я ее уже во все щели отымел пока ты полз на своем корыте", + "У твоей бабочки отвалились крылышки", + "Садись в свое корыто и вали отсюда", + "Свободен!", + "Шо, и тебе колено прострелить?", + "Если ты ищешь даму своего сердца, то ты опоздал", + "Ищешь кого-то? Тут ты никого не найдешь", + "А ты что тут забыл?", + "Ты потерялся? Показать дорогу нахуй?", + "Я конечно не баба, но можно попробовать" } } -- bomji @@ -3921,7 +3930,7 @@ function pttStart() pttName = pttArr[pttStatus].names[math.random(1, #pttArr[pttStatus].names)] create3DtextPtt(pttName, pttX, pttY, pttZ) pttTime = os.time() - local text = string.format(" SMS: %s ! : %0.2d . : Prostitute_Radar", pttName, getDistanceBetweenCoords3d(x, y, z, pttX, pttY, pttZ)) + local text = string.format(" SMS: %s ждёт Вас! Дистанция: %0.2d м. Отправитель: Prostitute_Radar", pttName, getDistanceBetweenCoords3d(x, y, z, pttX, pttY, pttZ)) sampAddChatMessage(text, 0xFFFFFF00) removeBlip(pttBlip) pttBlip = addBlipForCoord(pttX, pttY, pttZ) @@ -3971,7 +3980,7 @@ function doPtt() createActor(999, pttArr[pttStatus].skins[math.random(1, #pttArr[pttStatus].skins)], pttX, pttY, pttZ, pttHeading, 100.0) pttName = pttArr[pttStatus].names[math.random(1, #pttArr[pttStatus].names)] create3DtextPtt(pttName, pttX, pttY, pttZ) - local text = string.format(" SMS: . : Prostitute_Radar") + local text = string.format(" SMS: Слишком долго. Отправитель: Prostitute_Radar") sampAddChatMessage(text, 0xFFFFFF00) end @@ -4064,7 +4073,7 @@ end luChecker = { vehicles = {}, - truckers = {}, -- + truckers = {}, -- Игроки не в скрипте price_set = {}, trailer_delete = {}, load_position = { x = 0.0, y = 0.0, z = 0.0 } @@ -4072,10 +4081,10 @@ luChecker = { --[[ - - 3 - - 3 + разгрузил эвент + сменился 3д текст эвент + разгрузил эвент + сменился 3д текст эвент ]] @@ -4166,7 +4175,7 @@ function luChecker.trailerSync(playerId, data) end end -function luChecker.checkerLoad(playerId, data, position) -- +function luChecker.checkerLoad(playerId, data, position) -- Проверка когда игрок получил груз if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then if getLocalPlayerId() ~= playerId then local trucker_x, trucker_y, trucker_z = position.x, position.y, position.z @@ -4190,7 +4199,7 @@ function luChecker.checkerLoad(playerId, data, position) -- end function luChecker.set3Dtext(type, data_old, data, position) - if type == "" then + if type == "Порт" then for key = 1, 3 do if tonumber(data_old[key]) ~= 0 and not (tonumber(data_old[key]) == tonumber(data[1])) then if tonumber(data_old[key]) > tonumber(data[key]) then @@ -4198,7 +4207,7 @@ function luChecker.set3Dtext(type, data_old, data, position) end end end - elseif type == "" then + elseif type == "Склад" then local cargoName = data[2] local cargoId = (cargoName:find("n") and 1 or (cargoName:find("y") and 2 or (cargoName:find("l") and 3 or 0))) if cargoId ~= 0 then @@ -4386,7 +4395,7 @@ function openURL(url, fpath) if (text:find("Not found") and not text:find('"Not found"')) or text == "" then text = "" - addChatMessage(" :") + addChatMessage("Не удалось скачать обновление по ссылке:") addChatMessage(url) end @@ -4400,9 +4409,9 @@ function addChatMessage(text) end script_update = { - version_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/master/version", - script_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/master/TruckHUD.lua", - changelog_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/master/changelog", + version_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/test-utf-8/version", + script_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/test-utf-8/TruckHUD.lua", + changelog_url = "http://git.deadpoo.net/rubin/TruckHUD/raw/branch/test-utf-8/changelog", address_ini = "rubin-mods-updates.ini", main = function() local name = thisScript().name @@ -4426,12 +4435,12 @@ script_update = { if result then ini[name].server_version = text if text ~= "" and not string.find(text, thisScript().version) then - addChatMessage( string.format(" '%s'. : '%s'", text, thisScript().version) ) + addChatMessage( string.format("Вышла новая версия '%s'. Текущая: '%s'", text, thisScript().version) ) if ini[name].auto_update then - addChatMessage( string.format(" . !") ) + addChatMessage( string.format("Автообновление скрипта включено. Процесс запущен!") ) script_update.command() else - addChatMessage( string.format(" . : /%s", command) ) + addChatMessage( string.format("Автообновление скрипта выключено. Обновить самому: /%s", command) ) end end end @@ -4445,7 +4454,7 @@ script_update = { local result, text = pcall(openURL, script_update.version_url, fpath) if result then if text ~= "" and not string.find(text, thisScript().version) then - addChatMessage( string.format(" '%s'. : '%s'", text, thisScript().version) ) + addChatMessage( string.format("Вышла новая версия '%s'. Текущая: '%s'", text, thisScript().version) ) local fpath = os.tmpname() local result, text = pcall(openURL, script_update.script_url, fpath) if result and text ~= "" and text:find(thisScript().name:gsub("%-", "%%-")) then @@ -4454,13 +4463,13 @@ script_update = { file:write(text) file:flush() io.close(file) - addChatMessage(" , !") + addChatMessage("Обновление завершено, скрипт перезагружен!") wait(500) thisScript():reload() end end else - addChatMessage(" !") + addChatMessage("У Вас установлена последняя версия!") end end end) @@ -4470,7 +4479,7 @@ script_update = { dialog = {}, init = function() if not sampIsChatCommandDefined("rubin-mods") then - sampAddChatMessage("{667dff}[RUBIN MODS]{FFFFFF} : /rubin-mods", 0xFFFFFFFF) + sampAddChatMessage("{667dff}[RUBIN MODS]{FFFFFF} Управление обновлениями скриптов: /rubin-mods", 0xFFFFFFFF) sampRegisterChatCommand("rubin-mods",script_update.menu.show) while true do wait(0) @@ -4513,7 +4522,7 @@ script_update = { for i = 1, #script_update.menu.text do text = text..script_update.menu.text[i].."\n" end - sampShowDialog(2160," : Rubin Mods","\t\n"..text,"","",5) + sampShowDialog(2160,"Обновление скриптов: Rubin Mods","Скрипт\tВерсия\n"..text,"Выбрать","Закрыть",5) end }, menu2 = { @@ -4526,25 +4535,25 @@ script_update = { script_update.menu2.dialog = {} local ini = inicfg.load({}, script_update.address_ini) local k = data.script_name - script_update.menu2.text[#script_update.menu2.text+1] = string.format(" %s", (ini[k].auto_update and "{59fc30}ON" or "{ff0000}OFF")) + script_update.menu2.text[#script_update.menu2.text+1] = string.format("Автообновление %s", (ini[k].auto_update and "{59fc30}ON" or "{ff0000}OFF")) script_update.menu2.dialog[#script_update.menu2.dialog+1] = function() ini[k].auto_update = not ini[k].auto_update inicfg.save(ini, script_update.address_ini) script_update.menu2.show(data) end if not ini[k].auto_update then - script_update.menu2.text[#script_update.menu2.text+1] = string.format(" %s", (ini[k].check_update and "{59fc30}ON" or "{ff0000}OFF")) + script_update.menu2.text[#script_update.menu2.text+1] = string.format("Проверять обновления %s", (ini[k].check_update and "{59fc30}ON" or "{ff0000}OFF")) script_update.menu2.dialog[#script_update.menu2.dialog+1] = function() ini[k].check_update = not ini[k].check_update inicfg.save(ini, script_update.address_ini) script_update.menu2.show(data) end end - script_update.menu2.text[#script_update.menu2.text+1] = string.format(" ") + script_update.menu2.text[#script_update.menu2.text+1] = string.format("Последние изменения") script_update.menu2.dialog[#script_update.menu2.dialog+1] = function() script_update.changelog(ini[k].changelog_url) end - script_update.menu2.text[#script_update.menu2.text+1] = string.format(" ") + script_update.menu2.text[#script_update.menu2.text+1] = string.format("Удалить из списка") script_update.menu2.dialog[#script_update.menu2.dialog+1] = function() ini[k] = nil inicfg.save(ini, script_update.address_ini) @@ -4555,14 +4564,66 @@ script_update = { for i = 1, #script_update.menu2.text do text = text..script_update.menu2.text[i].."\n" end - sampShowDialog(2162," "..data.script_name,text,"","",2) + sampShowDialog(2162,"Настройки обновления для "..data.script_name,text,"Выбрать","Назад",2) end }, changelog = function(url, data) local fpath = os.tmpname() local result, text = pcall(openURL, url, fpath) if result then - sampShowDialog(2161,"Changelog - "..thisScript().name,text,"","",4) + sampShowDialog(2161,"Changelog - "..thisScript().name,text,"Выбрать","Назад",4) end end } + +-->> SCRIPT UTF-8 +function utf8_function(utf8_func, in_encoding, out_encoding) + for i = 1, #utf8_func do + if _G[utf8_func[i][1]] ~= nil then + local new_function = function(...) + local pack = table.pack(...) + for i = 1, pack.n do + if type(pack[i]) == "string" then + pack[i] = in_encoding(pack[i]) + end + end + local result = {utf8_func[i][1000](table.unpack(pack))} + for i = 1, #result do + if type(result[i]) == "string" then + result[i] = out_encoding(result[i]) + end + end + return table.unpack(result) + end + if #utf8_func[i] == 1 then + utf8_func[i][1000] = _G[utf8_func[i][1]] + _G[utf8_func[i][1]] = new_function + else + utf8_func[i][1000] = _G[utf8_func[i][1]][utf8_func[i][2]] + _G[utf8_func[i][1]][utf8_func[i][2]] = new_function + end + end + end +end + +--- decode = Utf8ToAnsi / encode = AnsiToUtf8 +function AnsiToUtf8(text) + return u8(text) +end +function Utf8ToAnsi(text) --> ANSI to UTF-8 + return u8:decode(text) +end + +utf8_function({ + { "sampShowDialog" }, + { "sampSendChat" }, + { "sampAddChatMessage" }, + { "print" }, + { "renderGetFontDrawTextLength" }, + { "renderFontDrawText" }, + { "sampSetCurrentDialogEditboxText" } +}, Utf8ToAnsi, AnsiToUtf8) +utf8_function({ + { "sampGetDialogCaption" }, + { "sampHasDialogRespond" } +}, AnsiToUtf8, AnsiToUtf8) \ No newline at end of file diff --git a/changelog b/changelog index 3e4d53d..e789585 100644 --- a/changelog +++ b/changelog @@ -1,10 +1,10 @@ - 20.01.2023 +Версия от 20.01.2023 - "G", - - , - , , - - Space +Фикс принятия пары с кнопкой "G", когда напарник уже стоит +Фикс ложных сообщений соло-чекера о сдачи в порту ЛС, если у вас стояло Дерево +Фикс уведомления о том, что вас добавили в пару, если напарник вышел из игры +Убрано отключение круиз-контроля на Space - 22.01.2023 +Версия от 22.01.2023 - /truckhud-update \ No newline at end of file +Теперь /truckhud-update проверяет обновления и обновляет скрипт \ No newline at end of file