diff --git a/TruckHUD.lua b/TruckHUD.lua old mode 100755 new mode 100644 index 1658f75..26f77f3 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -39,7 +39,7 @@ local dop_chat_light = { "Нефтезавод №1", "Нефтезавод №2", "Склад Угля №1", "Склад Угля №2", "Лесопилку №1", "Лесопилку №2", "Нефть в Порт ЛС", "Нефть в Порт СФ", "Уголь в Порт ЛС", "Уголь в Порт СФ", "Дерево в Порт ЛС", "Дерево в Порт СФ", " в Порт ЛС", " в Порт СФ" } for k,v in pairs(texts_of_reports) do - dop_chat_light[#dop_chat_light+1] = v + dop_chat_light[#dop_chat_light+1] = v end local find_3dText = { @@ -110,7 +110,7 @@ local _3dTextplayers = {} local live = os.time() --- pair mode new -parking_pair = { +parking_pair = { { [1] = { 251.32167053223, 1420.3039550781, 11.5, 15.0 }, -- N1 [2] = { -1048.6430664063, -660.54699707031, 33.012603759766, 10.0 } -- N2 @@ -181,7 +181,7 @@ function main() server = (server:find("02") and "Two" or (server:find("Revolution") and "Revolution" or - (server:find("Legacy") and "Legacy" or (server:find("Classic") and "Classic" or + (server:find("Legacy") and "Legacy" or (server:find("Classic") and "Classic" or (server:find("Zero Two") and "Two" or ""))))) if server == "" then thisScript():unload() @@ -220,7 +220,7 @@ function main() repeat wait(0) - until msk_timestamp ~= 0 + until msk_timestamp ~= 0 while true do wait(0) live = os.time() @@ -246,7 +246,7 @@ function settings_load() local x1, y1 = convertGameScreenCoordsToWindowScreenCoords(14.992679595947, 274.75) local x2, y2 = convertGameScreenCoordsToWindowScreenCoords(146.17861938477, 345.91665649414) local x3, y3 = convertGameScreenCoordsToWindowScreenCoords(529.42901611328, 158.08332824707) - defaultMon = + 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!] ]] local table_std = { Settings = { @@ -313,9 +313,9 @@ function settings_load() Load = 500, UnLoad = 800 }, - tmonitor = { + tmonitor = { 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 + 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 !ИдПары Разгружаюсь' }, @@ -339,7 +339,7 @@ function settings_load() inifiles = decodeJson(file:read("*a")) io.close(file) end - end, + end, function(e) sampAddChatMessage("[TruckHUD] Ошибка чтения конфига! Сбрасываю конфиг!", 0xff0000) local file, error = io.open(AdressJson, "w") @@ -393,7 +393,7 @@ function doControl() not sampIsDialogActive() and not sampIsScoreboardOpen() then - dialogActiveClock = os.time() + dialogActiveClock = os.time() sampSetCursorMode(3) local X, Y = getScreenResolution() if not control then @@ -437,8 +437,8 @@ function doControl() end if i == 5 then inifiles.Settings.luCheckerCargo = inifiles.Settings.luCheckerCargo + 1 - if inifiles.Settings.luCheckerCargo >= 4 then - inifiles.Settings.luCheckerCargo = 0 + if inifiles.Settings.luCheckerCargo >= 4 then + inifiles.Settings.luCheckerCargo = 0 end luChecker.load_position.x, luChecker.load_position.y, luChecker.load_position.z = 7777.0, 7777.0, 7777.0 settings_save() @@ -589,7 +589,7 @@ function doDialog() ShowDialog1(4, 4) else inifiles.Settings.Cruise = not inifiles.Settings.Cruise - if inifiles.Settings.Cruise then + if inifiles.Settings.Cruise then sampAddChatMessage('Для активации когда едете нажмите '..inifiles.Settings.Key4:gsub('VK_', '')..'. Чтобы отключить нажмите W.', -1) end settings_save() @@ -651,6 +651,15 @@ function doDialog() ShowDialog1(8) end end + if str:find("Соло") then + inifiles.Settings.luCheckerCargo = inifiles.Settings.luCheckerCargo + 1 + if inifiles.Settings.luCheckerCargo >= 4 then + inifiles.Settings.luCheckerCargo = 0 + end + luChecker.load_position.x, luChecker.load_position.y, luChecker.load_position.z = 7777.0, 7777.0, 7777.0 + settings_save() + ShowDialog1(1) + end if str:find("Доклады в SMS") then inifiles.Settings.SMSpara = not inifiles.Settings.SMSpara settings_save() @@ -878,7 +887,7 @@ function doDialog() end if caption == 'Truck-HUD: Биндер' then if result then - if button == 1 and #input > 0 then + if button == 1 and #input > 0 then if d[2] == 1 then if not binder_mode_sms then inifiles.binder[#inifiles.binder + 1] = input @@ -983,7 +992,7 @@ function doPair() -- Содержать переменную готовности локального перса -- Содержать переменную готовности напарника - + if pair_table["pos"] ~= nil then local x, y, z = getCharCoordinates(playerPed) local result_find = false @@ -1046,7 +1055,7 @@ function doCruise() if not inifiles.Settings.Cruise then return end if cruise == nil then cruise = false end if not isCharInAnyCar(playerPed) then - if cruise then + if cruise then cruise = false printStringNow('~R~Cruise Control - OFF', 1500) end @@ -1060,7 +1069,7 @@ function doCruise() end if not sampIsChatInputActive( ) and not sampIsDialogActive( ) and not sampIsCursorActive( ) then if pressW ~= nil and not isKeyDown(87) then - pressW = nil + pressW = nil end if not cruise and isKeyDown(87) and isKeyDown(vkeys[inifiles.Settings.Key4]) and isCarEngineOn(car) and isCharInAnyCar(playerPed) then cruise = true @@ -1149,9 +1158,9 @@ function doRenderStats() (workload == 1 and "Un" or "") .. "Load: " .. inifiles.Price[(workload == 1 and "UnLoad" or "Load")] .. "] " or " {" .. autoColor .. "}[" .. (workload == 1 and "Un" or "") .. "Load] ") - if - os.difftime(msk_timestamp, timer) > 180 and - autoh and + if + os.difftime(msk_timestamp, timer) > 180 and + autoh and (not isPairModeActive() or (isPairModeActive() and (pair_ready and player_ready))) and not (isPairModeActive() and inifiles.Settings.auto_load_unload_kd_pair_use and base[pair_mode_name].gruz == current_load and os.difftime(msk_timestamp, base[pair_mode_name].timer) <= 180) then @@ -1288,7 +1297,7 @@ function doRenderStats() string_render, Y = string.format("{%s} [{%s}%s{%s}] %s (%s m)", c2, (timer_d < 11 and (timer_d > 0 and 'b50000' or c2) or c2), (timer_d > 0 and string.format('%d:%02d', math.floor(timer_d / 60), timer_d % 60) or '0:00'), c2, para_pos.text, math.ceil(para_pos.dist)), Y + height drawClickableText(string_render, X, Y) end - + if delay.skill == -1 then delay.skill = 1 end @@ -1527,7 +1536,7 @@ function doLocalBlock(button, list, input, caption) end if caption:find('2') then if button == 1 then - if dialogFunc[list + 1] ~= nil then + if dialogFunc[list + 1] ~= nil then dialogFunc[list + 1]() end LocalBlock(2) @@ -1537,7 +1546,7 @@ function doLocalBlock(button, list, input, caption) end if caption:find('3') then if button == 1 then - if dialogFunc[list + 1] ~= nil then + if dialogFunc[list + 1] ~= nil then dialogFunc[list + 1]() end LocalBlock(3) @@ -1566,9 +1575,9 @@ function LocalBlock(int, param) 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) - dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] + dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] dialogText = string.format('%s \n', dialogText) - dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] + dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] end end settings_save() @@ -1588,9 +1597,9 @@ function LocalBlock(int, param) 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) - dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] + dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] dialogText = string.format('%s \n', dialogText) - dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] + dialogFunc[#dialogFunc + 1] = dialogFunc[#dialogFunc] end end settings_save() @@ -1634,7 +1643,7 @@ function ShowStats(int, param) 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, + v.razgruzkacount, v.razgruzka, v.refillcount, v.refill, v.repaircount, v.repair, v.kanistrcount, v.kanistr, @@ -1671,7 +1680,7 @@ function ShowStats(int, param) tonumber(param[3]), param[1], v.arendacount, v.arenda, v.zagruzkacount, v.zagruzka, - v.razgruzkacount, v.razgruzka, + v.razgruzkacount, v.razgruzka, v.refillcount, v.refill, v.repaircount, v.repair, v.kanistrcount, v.kanistr, @@ -1709,7 +1718,7 @@ function ShowStats(int, param) 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, + all.razgruzkacount, all.razgruzka, all.refillcount, all.refill, all.repaircount, all.repair, all.kanistrcount, all.kanistr, @@ -1757,7 +1766,7 @@ function WhileShowStats(button, list) return end if dialogINT == 3 then - if type(dialogKeytoList[1]) == 'table' then + if type(dialogKeytoList[1]) == 'table' then if button == 1 then ShowStats(4, { dialogKeytoList[list + 1][1], dialogKeytoList[list + 1][2], dialogKeytoList[list + 1][3] }) else @@ -1840,6 +1849,12 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) (pair_mode and "Режим пары\t{59fc30}" .. pair_mode_name .. "[" .. pair_mode_id .. "]" or "Режим пары\t{ff0000}OFF") + local text = { "{ff0000}OFF", "{59fc30}Нефть", "{59fc30}Уголь", "{59fc30}Дерево" } + if text[inifiles.Settings.luCheckerCargo+1] ~= nil then + dialogLine[#dialogLine + 1] = + "Соло-чекер\t" .. (text[inifiles.Settings.luCheckerCargo+1]) + end + dialogLine[#dialogLine + 1] = "Авто Доклады в SMS (режим пары)\t" .. (inifiles.Settings.SMSpara == true and "{59fc30}ON" or "{ff0000}OFF") @@ -1858,7 +1873,7 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) dialogLine[#dialogLine + 1] = "Скрывать чат профсоюза\t" .. (inifiles.Settings.ChatOFF == true and "{59fc30}ON" or "{ff0000}OFF") - if inifiles.Settings.ChatOFF == false then + if inifiles.Settings.ChatOFF == false then dialogLine[#dialogLine + 1] = "Чат профсоюза только в фуре\t" .. (inifiles.Settings.chat_in_truck == true and "{59fc30}ON" or "{ff0000}OFF") end @@ -1874,7 +1889,7 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) (inifiles.Settings.transponder == true and "{59fc30}ON" or "{ff0000}OFF") if inifiles.Settings.transponder then - dialogLine[#dialogLine + 1] = + dialogLine[#dialogLine + 1] = "Карта с позицией напарника\t".. (inifiles.Settings.fastmap == true and "{59fc30}ON" or "{ff0000}OFF") end @@ -1918,7 +1933,7 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) 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") @@ -2017,7 +2032,7 @@ function ShowDialog1(int, dtext, dinput, string_or_number, ini1, ini2) "Truck-HUD: Редактор HUD", [[{ffffff}Замены для составления HUD статистики -{ff0000}ТЕКУЩИЙ ТЕКСТ HUD ПОМЕЩЕН В ВАШ БУФЕР ОБМЕНА +{ff0000}ТЕКУЩИЙ ТЕКСТ HUD ПОМЕЩЕН В ВАШ БУФЕР ОБМЕНА СВЕРНИТЕ ИГРУ {ff0000}ОТКРОЙТЕ БЛОКНОТ В WINDOWS И ВСТАВЬТЕ ТУДА ТЕКСТ CTRL + V {ff0000}ПОСЛЕ ВНЕСЕНИЯ ИЗМЕНЕНИЙ СКОПИРУЙТЕ КОД СТАТИСТИКИ @@ -2225,7 +2240,7 @@ function loadEvents() if delay.paycheck == 2 then delay.paycheck = 0 return false - end + end end if string.find(message, " .+<.+>: .+") and inifiles ~= nil then if string.find(message, my_nick) then @@ -2242,7 +2257,7 @@ function loadEvents() return false end end - + if pair_mode and inifiles.Settings.LightingPara and string.find(message, pair_mode_name) then paraColor = "{"..inifiles.Settings.ColorPara.."}" color = "0xFF" .. inifiles.Settings.ColorPara @@ -2289,7 +2304,7 @@ function loadEvents() return false end end - if result then + if result then sampAddChatMessage(message, 0xFF30A0A7) return false end @@ -2495,11 +2510,11 @@ function loadEvents() write_table_log('razgruzka', {Z1, Z2, (Z1 - Z2)}, 2) else if tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) ~= inifiles.Trucker.MaxZP then - local param4 = ((tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) + Z2) - + local param4 = ((tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp) + Z2) - inifiles.Trucker.MaxZP - Z2) local param5 = string.match(param4, "-(.*)") write_table_log('razgruzka', {param5, param5, 0}, 2) - end + end end delay.unload = 0 if script_run then @@ -2690,7 +2705,7 @@ function loadEvents() lua_thread.create( function(id, color, position, distance, testLOS, attachedPlayerId, attachedVehicleId, textt) for k, v in pairs(find_3dText) do - + if string.find(text, v) then if (msk_timestamp - id_3D_text) > 1 then wait_auto = msk_timestamp @@ -2796,7 +2811,7 @@ function loadEvents() say("Удалено "..key[i]) end - end + end end, Cid) end end @@ -2846,7 +2861,7 @@ function write_table_log(key, param, Log) end if key == 'razgruzka' then - if inifiles.Trucker.MaxZP > tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp)then + if inifiles.Trucker.MaxZP > tonumber(inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)].zp)then if inifiles.Settings.HourLoad ~= os.date("%H", msk_timestamp) or inifiles.Settings.DataLoad ~= os.date("%d.%m.%Y", msk_timestamp) then inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)]['zp'] = inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].hour[os.date("%H", msk_timestamp)]['zp'] + tonumber(param[2]) inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].day['zp'] = inifiles.log[os.date("%d.%m.%Y", msk_timestamp)].day['zp'] + tonumber(param[2]) @@ -2891,8 +2906,8 @@ function logAvailable() settings_save() end if inifiles.log[os.date("%d.%m.%Y", msk_timestamp)] == nil then - inifiles.log[os.date("%d.%m.%Y", msk_timestamp)] = { - event = {}, + inifiles.log[os.date("%d.%m.%Y", msk_timestamp)] = { + event = {}, hour = {}, day = { arenda = 0, @@ -2986,7 +3001,7 @@ function check_version(update, downgrade_ver) end if status1 == dlstatus.STATUSEX_ENDDOWNLOAD then if goupdatestatus == nil then - sampAddChatMessage('Обновление прошло неудачно. Запускаю устаревшую версию.', 0xFF2f72f7) + sampAddChatMessage('Обновление прошло неудачно. Запускаю устаревшую версию.', 0xFF2f72f7) end end end @@ -3004,9 +3019,9 @@ function check_version(update, downgrade_ver) if f then local data = f:read("*a") if data == "TRUCKHUD" then - sampAddChatMessage('Такой версии нет в базе.', 0xFF2f72f7) + sampAddChatMessage('Такой версии нет в базе.', 0xFF2f72f7) else - sampAddChatMessage('Загрузка завершена!', 0xFF2f72f7) + sampAddChatMessage('Загрузка завершена!', 0xFF2f72f7) local file, error = io.open(thisScript().path, "w") if file ~= nil then file:write(data) @@ -3303,7 +3318,7 @@ function transponder() sampRegisterChatCommand("send",function(param) if param:find("(.+_.+) (%d+) (.+) (.+)") then local name, id, action, cargo = param:match("(.+_.+) (%d+) (.+) (.+)") - -- /send name id action cargo + -- /send name id action cargo solo_message_send = { name = name, id = tonumber(id), @@ -3328,7 +3343,7 @@ function transponder() local x, y, z = getCharCoordinates(playerPed) local result, myid = sampGetPlayerIdByCharHandle(PLAYER_PED) local myname = sampGetPlayerNickname(myid) - + if os.time() - solo_message_send.time > 5 then -- Очистить если данные устарели clearSoloMessage() end @@ -3337,7 +3352,7 @@ function transponder() server = ip .. ":" .. tostring(port), sender = myname, pos = {x = x, y = y, z = z, heading = getCharHeading(playerPed)}, - data = { + data = { pair_mode_name = pair_mode_name, is_truck = isTruckCar(), gruz = current_load, @@ -3437,12 +3452,12 @@ function transponder() minKD = monKD tmonitor = v.tmonitor end - end + end end end end if minKD ~= 1000000 then - if mon_ctime < tmonitor.time then + if mon_ctime < tmonitor.time then mon_time = tmonitor.time for k, v in pairs(prices_mon) do if tmonitor[k] ~= nil then @@ -3458,7 +3473,7 @@ function transponder() pair_timestamp = info.data.timestamp base[pair_mode_name].pos = { x = info.data.x, y = info.data.y, z = info.data.z } base[pair_mode_name].heading = info.data.heading - pair_table = base[pair_mode_name] + pair_table = base[pair_mode_name] pair_status = 200 if para_message_send == nil then para_message_send = 1 @@ -3475,7 +3490,7 @@ function transponder() error_message('2', '') pair_status = info.reason error_message('1', pair_mode_name.."["..pair_mode_id.."] не найден в базе игроков TruckHUD") - elseif info.reason == 425 then + elseif info.reason == 425 then error_message('2', 'Слишком частые запросы на хостинг. Разберитесь с этим или обратитесь за помощью в группу vk.com/rubin.mods') end end @@ -3618,15 +3633,15 @@ function fastmap() wait(0) if inifiles.Settings.transponder and inifiles.Settings.fastmap then if sampIsDialogActive() then - dialogActiveClock = os.time() + dialogActiveClock = os.time() end if pair_mode and pair_status == 200 and - not sampIsDialogActive() and - (os.time() - dialogActiveClock) > 1 and + not sampIsDialogActive() and + (os.time() - dialogActiveClock) > 1 and not sampIsScoreboardOpen() and - not isSampfuncsConsoleActive() and + not isSampfuncsConsoleActive() and ( (isKeyDown(vkeys[inifiles.Settings.Key3]) and isKeyDown(vkeys[inifiles.Settings.Key2]) or (isTruckCar() and isKeyDown(vkeys[inifiles.Settings.Key3])))) then fastmapshow = true @@ -3663,7 +3678,7 @@ function getY(y) y = math.floor(y * -1 + 3000) return bY + y * (size / 6000) - iconsize / 2 end - + function onScriptTerminate(LuaScript, quitGame) if LuaScript == thisScript() then stop_downloading_1 = true @@ -3752,7 +3767,7 @@ function showTruckers() 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..']')) end - end + end end sampShowDialog(0, 'Дальнобойщики со скриптом в сети: '..trucker_count, (#dialogText == 0 and 'Список пуст' or dialogText), 'Выбрать', 'Закрыть', 5) end @@ -3773,18 +3788,18 @@ function renderTruckers() local car = storeCarCharIsInNoSave(ped) local result, idcar = sampGetVehicleIdByCarHandle(car) if _3dTextplayers[id] == nil and result then - _3dTextplayers[id] = sampCreate3dText(' ', -1, 0.0, 0.0, 0.0, 30.0, false, -1, idcar) + _3dTextplayers[id] = sampCreate3dText(' ', -1, 0.0, 0.0, 0.0, 30.0, false, -1, idcar) end if _3dTextplayers[id] ~= nil and result then local timer_player = 180 - (base[nickname].timer > 1000 and os.difftime(msk_timestamp, base[nickname].timer) or 181) local color = (timer_player <= 0 and inifiles.Render.Color2 or (timer_player <= 10 and 'b50000' or inifiles.Render.Color2)) - local kd_player = (timer_player > 0 - and - string.format('{%s}<< {%s}%d:%02d {%s}>>', inifiles.Render.Color1, color, math.floor(timer_player / 60), timer_player % 60, inifiles.Render.Color1) - or + local kd_player = (timer_player > 0 + and + string.format('{%s}<< {%s}%d:%02d {%s}>>', inifiles.Render.Color1, color, math.floor(timer_player / 60), timer_player % 60, inifiles.Render.Color1) + or 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, + 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 'Нет')))) ) local para_player = string.format('{%s}%s', inifiles.Render.Color2, @@ -3839,7 +3854,7 @@ end ---->>> +--->>> function loadPtt() pttCreate = false @@ -3949,7 +3964,7 @@ function pttStart() local pttPos = (dist_portLS < dist_portSF and 1 or 2) local randPos = math.random(1, #pttCoord[pttPos]) pttX, pttY, pttZ, pttHeading = pttCoord[pttPos][randPos][1], pttCoord[pttPos][randPos][2], pttCoord[pttPos][randPos][3], pttCoord[pttPos][randPos][4] - + createActor(999, pttArr[pttStatus].skins[math.random(1, #pttArr[pttStatus].skins)], pttX, pttY, pttZ + 0.5, pttHeading, 100.0) animActor(999, "STRIP", pttAnim[math.random(1, #pttAnim)], 4.1, 0, 0, 0, 0, 0) pttName = pttArr[pttStatus].names[math.random(1, #pttArr[pttStatus].names)] @@ -4043,12 +4058,12 @@ end function animActor(actorId, animLib, animName, frameDelta, loop, lockX, lockY, freeze, time) clearAnimActor(actorId) local bs = raknetNewBitStream() - raknetBitStreamWriteInt16(bs,actorId) + raknetBitStreamWriteInt16(bs,actorId) raknetBitStreamWriteInt8(bs, #animLib) raknetBitStreamWriteString(bs, animLib) raknetBitStreamWriteInt8(bs, #animName) raknetBitStreamWriteString(bs, animName) - raknetBitStreamWriteFloat(bs,frameDelta) + raknetBitStreamWriteFloat(bs,frameDelta) raknetBitStreamWriteBool(bs,loop) raknetBitStreamWriteBool(bs,lockX) raknetBitStreamWriteBool(bs,lockY) @@ -4068,8 +4083,8 @@ end function setActorPos(actorId, x, y, z) local bs = raknetNewBitStream() raknetBitStreamWriteInt16(bs,actorId) - raknetBitStreamWriteFloat(bs,x) - raknetBitStreamWriteFloat(bs,y) + raknetBitStreamWriteFloat(bs,x) + raknetBitStreamWriteFloat(bs,y) raknetBitStreamWriteFloat(bs,z) raknetEmulRpcReceiveBitStream(176,bs) raknetDeleteBitStream(bs) @@ -4208,7 +4223,7 @@ function luChecker.checkerLoad(playerId, data, position) -- local local_x, local_y, local_z = getCharCoordinates(PLAYER_PED) local dist_localPlayer_storage = getDistanceBetweenCoords3d(local_x, local_y, local_z, x, y, z) local dist_trucker_storage = getDistanceBetweenCoords3d(trucker_x, trucker_y, trucker_z, x, y, z) - + if dist_localPlayer_storage <= 120.0 and dist_trucker_storage <= 50.0 then if key == "ls" or key == "sf" then if inifiles.Settings.luCheckerCargo >= 1 and inifiles.Settings.luCheckerCargo <= 3 then @@ -4281,7 +4296,7 @@ function luChecker.checker() say(">> "..text) end end - + table.remove(luChecker.trailer_delete, 1) table.remove(luChecker.price_set, 1) end