add key G for accept pair mode

test-utf-8
rubin 2 years ago
parent 0fbec86f19
commit e33996b5c3
  1. 33
      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

Loading…
Cancel
Save