From 00794ff84d26f12b92d13fb916e38624b9fbcd3f Mon Sep 17 00:00:00 2001 From: lionur Date: Fri, 20 Jan 2023 21:41:22 +0300 Subject: [PATCH] fix port ls & fix pair G button & fix offline pair --- TruckHUD.lua | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/TruckHUD.lua b/TruckHUD.lua index 1bdfa74..6b39e98 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -3342,13 +3342,17 @@ function transponder() for k,v in pairs(base) do if v.pair_mode_name == myname then if new_pair[k] == nil then - new_pair[k] = true - sampAddChatMessage('TruckHUD: Игрок '..k..'['..v.id..'] добавил Вас в режим пары.', -1) - sampAddChatMessage('TruckHUD: Нажмите {e63939}"G"{FFFFFF} чтобы принять его в напарники.', -1) - pair_yes = { - time = os.time(), - id = v.id - } + if sampIsPlayerConnected(v.id) and sampGetPlayerNickname(v.id) == k then + new_pair[k] = true + sampAddChatMessage('TruckHUD: Игрок '..k..'['..v.id..'] добавил Вас в режим пары.', -1) + if pair_mode_id ~= v.id then + sampAddChatMessage('TruckHUD: Нажмите {e63939}"G"{FFFFFF} чтобы принять его в напарники.', -1) + pair_yes = { + time = os.time(), + id = v.id + } + end + end end end if new_pair[k] ~= nil and v.pair_mode_name ~= myname then @@ -3431,6 +3435,15 @@ function transponder() end end +function fix_l(symbol, cargo_msg) + if symbol == "l" then + if cargo_msg == "lsn" or cargo_msg == "lsy" then + return false + end + end + return true +end + solo_antiflood_message = {} function transponder_solo_message(info) if info.solo_data ~= nil then @@ -3443,8 +3456,9 @@ function transponder_solo_message(info) 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) 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 -- Поиск дубликата local counter = 0 for s = 1, #check_label do