|
|
@ -4212,14 +4212,16 @@ function luChecker.checkerLoad(playerId, data, position) -- |
|
|
|
if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then |
|
|
|
if luChecker.truckers[playerId]["trailerData"]["trailerId"] ~= data["trailerId"] then |
|
|
|
sampAddChatMessage(data["trailerId"],-1) |
|
|
|
sampAddChatMessage(data["trailerId"],-1) |
|
|
|
if getLocalPlayerId() ~= playerId then |
|
|
|
if getLocalPlayerId() ~= playerId then |
|
|
|
local x, y, z = luChecker.load_position.x, luChecker.load_position.y, luChecker.load_position.z |
|
|
|
|
|
|
|
local local_x, local_y, local_z = getCharCoordinates(PLAYER_PED) |
|
|
|
|
|
|
|
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 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_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 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 dist_localPlayer_storage <= 120.0 and dist_trucker_storage <= 50.0 then |
|
|
|
local key = getKeysPoint(trucker_x, trucker_y, trucker_z) |
|
|
|
|
|
|
|
if key == "ls" or key == "sf" then |
|
|
|
if key == "ls" or key == "sf" then |
|
|
|
if inifiles.Settings.luCheckerCargo >= 1 and inifiles.Settings.luCheckerCargo <= 3 then |
|
|
|
if inifiles.Settings.luCheckerCargo >= 1 and inifiles.Settings.luCheckerCargo <= 3 then |
|
|
|
key = key..cargo_replace[inifiles.Settings.luCheckerCargo] |
|
|
|
key = key..cargo_replace[inifiles.Settings.luCheckerCargo] |
|
|
@ -4326,14 +4328,18 @@ end |
|
|
|
|
|
|
|
|
|
|
|
function getKeysPoint(x, y, z) |
|
|
|
function getKeysPoint(x, y, z) |
|
|
|
local minDist, minResult = 1000000, "" |
|
|
|
local minDist, minResult = 1000000, "" |
|
|
|
|
|
|
|
local resX, resY, resZ = 0.0, 0.0, 0.0 |
|
|
|
for name, cord in pairs(location_keys) do |
|
|
|
for name, cord in pairs(location_keys) do |
|
|
|
local distance = getDistanceBetweenCoords3d(x, y, z, cord.x, cord.y, cord.z) |
|
|
|
if not name:find("Àðåíäà") and not name:find("Ïîðò") then |
|
|
|
if distance < minDist then |
|
|
|
local distance = getDistanceBetweenCoords3d(x, y, z, cord.x, cord.y, cord.z) |
|
|
|
minDist = distance |
|
|
|
if distance < minDist then |
|
|
|
minResult = name |
|
|
|
minDist = distance |
|
|
|
|
|
|
|
minResult = name |
|
|
|
|
|
|
|
resX, resY, resZ = cord.x, cord.y, cord.z |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
return minResult |
|
|
|
return minResult, resX, resY, resZ |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|