fix cargo load message & fix select cargo

test-utf-8
rubin 2 years ago
parent c7c2b26519
commit 0cd85aeff8
  1. 36
      TruckHUD.lua

@ -3533,7 +3533,7 @@ function transponder_solo_message(info)
counter = counter + 1
end
end
if counter == 4 and solo_data["time"] - solo_data_antiflood[sender][i]["time"] < 10 then
if counter == 4 and os.time() - solo_data_antiflood[sender][i]["antiflood"] < 10 then
result_find = true
break
end
@ -3545,6 +3545,7 @@ function transponder_solo_message(info)
end
end
solo_data_antiflood[sender][#solo_data_antiflood[sender]+1] = solo_data
solo_data_antiflood[sender][#solo_data_antiflood[sender]]["antiflood"] = os.time()
end
end
end
@ -4215,29 +4216,24 @@ function luChecker.checkerLoad(playerId, data, position) --
if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then
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)
local cargoNow = (key:find("n") and 1 or (key:find("y") and 2 or (key:find("l") and 3 or 0)))
if cargoNow == inifiles.Settings.luCheckerCargo and inifiles.Settings.luCheckerCargo ~= 0 then
local local_x, local_y, local_z = getCharCoordinates(PLAYER_PED)
local dist_localPlayer_storage = getDistanceBetweenCoords3d(local_x, local_y, local_z, x, y, z)
local dist_trucker_storage = getDistanceBetweenCoords3d(trucker_x, trucker_y, trucker_z, x, y, z)
local local_x, local_y, local_z = getCharCoordinates(PLAYER_PED)
local dist_localPlayer_storage = getDistanceBetweenCoords3d(local_x, local_y, local_z, x, y, z)
local dist_trucker_storage = getDistanceBetweenCoords3d(trucker_x, trucker_y, trucker_z, x, y, z)
if dist_localPlayer_storage <= 120.0 and dist_trucker_storage <= 50.0 then
if key == "ls" or key == "sf" then
if inifiles.Settings.luCheckerCargo >= 1 and inifiles.Settings.luCheckerCargo <= 3 then
key = key..cargo_replace[inifiles.Settings.luCheckerCargo]
end
if dist_localPlayer_storage <= 120.0 and dist_trucker_storage <= 50.0 then
solo_message_send = {
name = getNameById(playerId),
id = playerId,
action = "load",
cargo = key,
time = os.time()
}
sampAddChatMessage("èãðîê ïîëó÷èë ãðóç "..playerId.." "..dist_localPlayer_storage.." "..dist_trucker_storage.." +++ "..luChecker.truckers[playerId]["trailerData"]["trailerId"].." ++++ "..data["trailerId"],-1)
end
solo_message_send = {
name = getNameById(playerId),
id = playerId,
action = "load",
cargo = key,
time = os.time()
}
sampAddChatMessage("èãðîê ïîëó÷èë ãðóç "..playerId.." "..dist_localPlayer_storage.." "..dist_trucker_storage.." +++ "..luChecker.truckers[playerId]["trailerData"]["trailerId"].." ++++ "..data["trailerId"],-1)
end
end
end

Loading…
Cancel
Save