From 10e7bd64120bc9e7368122dcf44f37c31bf359ed Mon Sep 17 00:00:00 2001 From: rubin Date: Thu, 19 Jan 2023 13:13:59 +0300 Subject: [PATCH] delete debug info --- TruckHUD.lua | 48 +++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/TruckHUD.lua b/TruckHUD.lua index 93db5ac..c165f6a 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -2805,15 +2805,11 @@ function loadEvents() unload_location = false current_warehouse = "none" end - --say("remove 3d text "..Cid) local result, key = isTruck3dTextDefined(Cid) if result then for i = 1, #key do - --prices_3dtext_id[key[i]] = -1 prices_3dtext_id[key[i]] = nil prices_3dtext[key[i]] = 0 - - say("Удалено "..key[i]) end end end, Cid) @@ -2828,7 +2824,6 @@ function isTruck3dTextDefined(id) local dist = getDistanceBetweenCoords3d(x, y, z, prices_3dtext_pos[k].x, prices_3dtext_pos[k].y, prices_3dtext_pos[k].z) if id == v and v ~= -1 and dist > 20 then result = true - say(k) delete[#delete+1] = k end end @@ -3288,7 +3283,6 @@ function transponder() 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 -- Очистить если данные устарели - say("Очистка solo_message - устарело!!!") clearSoloMessage() end @@ -3366,8 +3360,6 @@ function transponder() if download_call == 0 then if request_table["info"]["solo_message"]["name"] == solo_message_send.name then clearSoloMessage() - else - say("ЗАЩИТА ОТ ПЕРЕЗАПИСИ СОЛО МЕССЕДЖ") end transponder_delay = info.delay response_timestamp = info.timestamp @@ -3504,9 +3496,6 @@ function transponder_solo_message(info) if af_say[key] == nil then af_say[key] = true - say(solo_data_antiflood[sender][i]["name"].." antiflood 10 sek!!") - say(os.time() - solo_data_antiflood[sender][i]["antiflood"].." sec") - say(counter) end end end @@ -4148,7 +4137,6 @@ function luChecker.vehicleStream(stream, vehicleId, data) local result, playerId, isTrailer = isVehicleTruckersDelete(luChecker.truckers, vehicleId) if result then if isTrailer then - say("traile delete") luChecker.trailer_delete[#luChecker.trailer_delete + 1] = { time = os.clock() * 1000, playerId = playerId, position = luChecker.truckers[playerId]["data"]["position"] } luChecker.truckers[playerId]["trailerData"] = { trailerId = -1 @@ -4199,8 +4187,6 @@ end function luChecker.checkerLoad(playerId, data, position) -- Проверка когда игрок получил груз if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then - say(luChecker.truckers[playerId]["trailerData"]["trailerId"].." - "..data["trailerId"]) - sampAddChatMessage(data["trailerId"],-1) if getLocalPlayerId() ~= playerId then local trucker_x, trucker_y, trucker_z = position.x, position.y, position.z local key, x, y, z = getKeysPoint(trucker_x, trucker_y, trucker_z) @@ -4217,7 +4203,6 @@ function luChecker.checkerLoad(playerId, data, position) -- cargo = key, time = os.time() } - sampAddChatMessage("игрок получил груз "..playerId.." "..dist_localPlayer_storage.." "..dist_trucker_storage.." +++ "..luChecker.truckers[playerId]["trailerData"]["trailerId"].." ++++ "..data["trailerId"],-1) end end end @@ -4226,11 +4211,9 @@ end function luChecker.set3Dtext(type, data_old, data, position) if type == "Порт" then for key = 1, 3 do - say(string.format("%s %s", data_old[key], data[key])) 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 luChecker.price_set[#luChecker.price_set + 1] = { type = "unload", old_price = tonumber(data_old[key]), new_price = tonumber(data[key]), time = os.clock() * 1000, position = position, key = key } - say("Разгрузка в порту рядом "..key) end end end @@ -4239,7 +4222,6 @@ function luChecker.set3Dtext(type, data_old, data, position) 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 luChecker.load_position = { x = position.x, y = position.y, z = position.z } - sampAddChatMessage("склад склад склад "..tonumber(data[1]), -1) end end end @@ -4259,7 +4241,6 @@ function luChecker.checker() if getLocalPlayerId() ~= playerId then local dist = getDistanceBetweenCoords3d(position_3dtext.x,position_3dtext.y,position_3dtext.z,position_trailer.x,position_trailer.y,position_trailer.z) - say("Дистанция от разгрузившегося до порта "..dist) if dist < 50 then local key = getPort(position_trailer.x,position_trailer.y,position_trailer.z) key = key..cargo_replace[luChecker.price_set[1].key] @@ -4270,8 +4251,6 @@ function luChecker.checker() cargo = key, time = os.time() } - local text = string.format("игрок %s %s %s %s", playerId, (luChecker.price_set[1].type == "load" and "загрузил" or "разгрузил"), key, dist ) - say(">> "..text) end end @@ -4301,7 +4280,6 @@ function clear_old_value(key) end end for i = 1, #delete do - say("remove "..key.." "..i) table.remove(luChecker[key], delete[i]) end end @@ -4482,19 +4460,19 @@ script_update = { end, command = function() lua_thread.create(function() - -- 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 - -- local file, error = io.open(thisScript().path, "w") - -- if file ~= nil then - -- file:write(text) - -- file:flush() - -- io.close(file) - -- addChatMessage("Обновление завершено, скрипт перезагружен!") - -- wait(500) - -- thisScript():reload() - -- end - -- end + 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 + local file, error = io.open(thisScript().path, "w") + if file ~= nil then + file:write(text) + file:flush() + io.close(file) + addChatMessage("Обновление завершено, скрипт перезагружен!") + wait(500) + thisScript():reload() + end + end end) end, menu = {