diff --git a/TruckHUD.lua b/TruckHUD.lua index e5202f4..25f693d 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -243,6 +243,7 @@ function main() doPtt() if script_run then if not sampIsScoreboardOpen() and sampIsChatVisible() and not isKeyDown(116) and not isKeyDown(121) and fastmapshow == nil then + doPair_G() doRenderStats() doRenderMon() doRenderBind() @@ -3221,6 +3222,33 @@ function clearSoloMessage() } end +function doPair_G() + if pair_yes ~= nil then + if os.time() - pair_yes.time < 60 then + if wasKeyPressed(vkeys["VK_G"]) then + pair_mode_id = tonumber(pair_yes.id) + if sampIsPlayerConnected(pair_mode_id) then + error_message(1, '') + para_message_send = nil + pair_mode_name = sampGetPlayerNickname(pair_mode_id) + menu[4][1] = "SMS » " .. pair_mode_name .. "[" .. pair_mode_id .. "]" + pair_mode = true + menu[4].run = true + transponder_delay = 100 + else + pair_mode_id = -1 + pair_mode = false + menu[4].run = false + sampAddChatMessage("Ошибка! Игрок под этим ID не в сети.", -1) + end + pair_yes = nil + end + else + pair_yes = nil + end + end +end + function transponder() new_pair = {} error_array = {} @@ -3353,6 +3381,11 @@ function transponder() 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 + } end end if new_pair[k] ~= nil and v.pair_mode_name ~= myname then