|
|
@ -2805,15 +2805,11 @@ function loadEvents() |
|
|
|
unload_location = false |
|
|
|
unload_location = false |
|
|
|
current_warehouse = "none" |
|
|
|
current_warehouse = "none" |
|
|
|
end |
|
|
|
end |
|
|
|
--say("remove 3d text "..Cid) |
|
|
|
|
|
|
|
local result, key = isTruck3dTextDefined(Cid) |
|
|
|
local result, key = isTruck3dTextDefined(Cid) |
|
|
|
if result then |
|
|
|
if result then |
|
|
|
for i = 1, #key do |
|
|
|
for i = 1, #key do |
|
|
|
--prices_3dtext_id[key[i]] = -1 |
|
|
|
|
|
|
|
prices_3dtext_id[key[i]] = nil |
|
|
|
prices_3dtext_id[key[i]] = nil |
|
|
|
prices_3dtext[key[i]] = 0 |
|
|
|
prices_3dtext[key[i]] = 0 |
|
|
|
|
|
|
|
|
|
|
|
say("Óäàëåíî "..key[i]) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end, Cid) |
|
|
|
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) |
|
|
|
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 |
|
|
|
if id == v and v ~= -1 and dist > 20 then |
|
|
|
result = true |
|
|
|
result = true |
|
|
|
say(k) |
|
|
|
|
|
|
|
delete[#delete+1] = k |
|
|
|
delete[#delete+1] = k |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -3288,7 +3283,6 @@ function transponder() |
|
|
|
local myname = sampGetPlayerNickname(myid) |
|
|
|
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 -- Î÷èñòèòü åñëè äàííûå óñòàðåëè |
|
|
|
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() |
|
|
|
clearSoloMessage() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -3366,8 +3360,6 @@ function transponder() |
|
|
|
if download_call == 0 then |
|
|
|
if download_call == 0 then |
|
|
|
if request_table["info"]["solo_message"]["name"] == solo_message_send.name then |
|
|
|
if request_table["info"]["solo_message"]["name"] == solo_message_send.name then |
|
|
|
clearSoloMessage() |
|
|
|
clearSoloMessage() |
|
|
|
else |
|
|
|
|
|
|
|
say("ÇÀÙÈÒÀ ÎÒ ÏÅÐÅÇÀÏÈÑÈ ÑÎËÎ ÌÅÑÑÅÄÆ") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
transponder_delay = info.delay |
|
|
|
transponder_delay = info.delay |
|
|
|
response_timestamp = info.timestamp |
|
|
|
response_timestamp = info.timestamp |
|
|
@ -3504,9 +3496,6 @@ function transponder_solo_message(info) |
|
|
|
|
|
|
|
|
|
|
|
if af_say[key] == nil then |
|
|
|
if af_say[key] == nil then |
|
|
|
af_say[key] = true |
|
|
|
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 |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -4148,7 +4137,6 @@ function luChecker.vehicleStream(stream, vehicleId, data) |
|
|
|
local result, playerId, isTrailer = isVehicleTruckersDelete(luChecker.truckers, vehicleId) |
|
|
|
local result, playerId, isTrailer = isVehicleTruckersDelete(luChecker.truckers, vehicleId) |
|
|
|
if result then |
|
|
|
if result then |
|
|
|
if isTrailer 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.trailer_delete[#luChecker.trailer_delete + 1] = { time = os.clock() * 1000, playerId = playerId, position = luChecker.truckers[playerId]["data"]["position"] } |
|
|
|
luChecker.truckers[playerId]["trailerData"] = { |
|
|
|
luChecker.truckers[playerId]["trailerData"] = { |
|
|
|
trailerId = -1 |
|
|
|
trailerId = -1 |
|
|
@ -4199,8 +4187,6 @@ end |
|
|
|
|
|
|
|
|
|
|
|
function luChecker.checkerLoad(playerId, data, position) -- Ïðîâåðêà êîãäà èãðîê ïîëó÷èë ãðóç |
|
|
|
function luChecker.checkerLoad(playerId, data, position) -- Ïðîâåðêà êîãäà èãðîê ïîëó÷èë ãðóç |
|
|
|
if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then |
|
|
|
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 |
|
|
|
if getLocalPlayerId() ~= playerId then |
|
|
|
local trucker_x, trucker_y, trucker_z = position.x, position.y, position.z |
|
|
|
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) |
|
|
|
local key, x, y, z = getKeysPoint(trucker_x, trucker_y, trucker_z) |
|
|
@ -4217,7 +4203,6 @@ function luChecker.checkerLoad(playerId, data, position) -- |
|
|
|
cargo = key, |
|
|
|
cargo = key, |
|
|
|
time = os.time() |
|
|
|
time = os.time() |
|
|
|
} |
|
|
|
} |
|
|
|
sampAddChatMessage("èãðîê ïîëó÷èë ãðóç "..playerId.." "..dist_localPlayer_storage.." "..dist_trucker_storage.." +++ "..luChecker.truckers[playerId]["trailerData"]["trailerId"].." ++++ "..data["trailerId"],-1) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -4226,11 +4211,9 @@ end |
|
|
|
function luChecker.set3Dtext(type, data_old, data, position) |
|
|
|
function luChecker.set3Dtext(type, data_old, data, position) |
|
|
|
if type == "Ïîðò" then |
|
|
|
if type == "Ïîðò" then |
|
|
|
for key = 1, 3 do |
|
|
|
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]) ~= 0 and not (tonumber(data_old[key]) == tonumber(data[1])) then |
|
|
|
if tonumber(data_old[key]) > tonumber(data[key]) 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 } |
|
|
|
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 |
|
|
|
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))) |
|
|
|
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 |
|
|
|
if cargoId ~= 0 then |
|
|
|
luChecker.load_position = { x = position.x, y = position.y, z = position.z } |
|
|
|
luChecker.load_position = { x = position.x, y = position.y, z = position.z } |
|
|
|
sampAddChatMessage("ñêëàä ñêëàä ñêëàä "..tonumber(data[1]), -1) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -4259,7 +4241,6 @@ function luChecker.checker() |
|
|
|
|
|
|
|
|
|
|
|
if getLocalPlayerId() ~= playerId then |
|
|
|
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) |
|
|
|
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 |
|
|
|
if dist < 50 then |
|
|
|
local key = getPort(position_trailer.x,position_trailer.y,position_trailer.z) |
|
|
|
local key = getPort(position_trailer.x,position_trailer.y,position_trailer.z) |
|
|
|
key = key..cargo_replace[luChecker.price_set[1].key] |
|
|
|
key = key..cargo_replace[luChecker.price_set[1].key] |
|
|
@ -4270,8 +4251,6 @@ function luChecker.checker() |
|
|
|
cargo = key, |
|
|
|
cargo = key, |
|
|
|
time = os.time() |
|
|
|
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 |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -4301,7 +4280,6 @@ function clear_old_value(key) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
for i = 1, #delete do |
|
|
|
for i = 1, #delete do |
|
|
|
say("remove "..key.." "..i) |
|
|
|
|
|
|
|
table.remove(luChecker[key], delete[i]) |
|
|
|
table.remove(luChecker[key], delete[i]) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -4482,19 +4460,19 @@ script_update = { |
|
|
|
end, |
|
|
|
end, |
|
|
|
command = function() |
|
|
|
command = function() |
|
|
|
lua_thread.create(function() |
|
|
|
lua_thread.create(function() |
|
|
|
-- local fpath = os.tmpname() |
|
|
|
local fpath = os.tmpname() |
|
|
|
-- local result, text = pcall(openURL, script_update.script_url, fpath) |
|
|
|
local result, text = pcall(openURL, script_update.script_url, fpath) |
|
|
|
-- if result and text ~= "" and text:find(thisScript().name:gsub("%-", "%%-")) then |
|
|
|
if result and text ~= "" and text:find(thisScript().name:gsub("%-", "%%-")) then |
|
|
|
-- local file, error = io.open(thisScript().path, "w") |
|
|
|
local file, error = io.open(thisScript().path, "w") |
|
|
|
-- if file ~= nil then |
|
|
|
if file ~= nil then |
|
|
|
-- file:write(text) |
|
|
|
file:write(text) |
|
|
|
-- file:flush() |
|
|
|
file:flush() |
|
|
|
-- io.close(file) |
|
|
|
io.close(file) |
|
|
|
-- addChatMessage("Îáíîâëåíèå çàâåðøåíî, ñêðèïò ïåðåçàãðóæåí!") |
|
|
|
addChatMessage("Îáíîâëåíèå çàâåðøåíî, ñêðèïò ïåðåçàãðóæåí!") |
|
|
|
-- wait(500) |
|
|
|
wait(500) |
|
|
|
-- thisScript():reload() |
|
|
|
thisScript():reload() |
|
|
|
-- end |
|
|
|
end |
|
|
|
-- end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
end, |
|
|
|
end, |
|
|
|
menu = { |
|
|
|
menu = { |
|
|
|