|
|
@ -2034,15 +2034,12 @@ end |
|
|
|
|
|
|
|
|
|
|
|
function loadEvents() |
|
|
|
function loadEvents() |
|
|
|
|
|
|
|
|
|
|
|
function sampev.onVehicleSync(vehicleId, data) |
|
|
|
function sampev.onVehicleSync(playerId, vehicleId, data) |
|
|
|
lua_thread.create(luChecker.vehicleSync, vehicleId, data) |
|
|
|
lua_thread.create(luChecker.vehicleSync, playerId, vehicleId, data) |
|
|
|
end |
|
|
|
end |
|
|
|
function sampev.onTrailerSync(playerId, data) |
|
|
|
function sampev.onTrailerSync(playerId, data) |
|
|
|
lua_thread.create(luChecker.trailerSync, playerId, data) |
|
|
|
lua_thread.create(luChecker.trailerSync, playerId, data) |
|
|
|
end |
|
|
|
end |
|
|
|
function sampev.onVehicleStreamIn(vehicleId, data) |
|
|
|
|
|
|
|
lua_thread.create(luChecker.vehicleStream, true, vehicleId, data) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
function sampev.onVehicleStreamOut(vehicleId) |
|
|
|
function sampev.onVehicleStreamOut(vehicleId) |
|
|
|
lua_thread.create(luChecker.vehicleStream, false, vehicleId) |
|
|
|
lua_thread.create(luChecker.vehicleStream, false, vehicleId) |
|
|
|
end |
|
|
|
end |
|
|
@ -2174,6 +2171,7 @@ function loadEvents() |
|
|
|
antiflood = os.clock() * 1000 |
|
|
|
antiflood = os.clock() * 1000 |
|
|
|
end |
|
|
|
end |
|
|
|
function sampev.onVehicleStreamIn(vehicleId, data) |
|
|
|
function sampev.onVehicleStreamIn(vehicleId, data) |
|
|
|
|
|
|
|
lua_thread.create(luChecker.vehicleStream, true, vehicleId, data) |
|
|
|
if inifiles ~= nil and not inifiles.Settings.Tuning and (data.type == 403 or data.type == 515) then |
|
|
|
if inifiles ~= nil and not inifiles.Settings.Tuning and (data.type == 403 or data.type == 515) then |
|
|
|
data.modSlots[8] = 0 |
|
|
|
data.modSlots[8] = 0 |
|
|
|
return {vehicleId, data} |
|
|
|
return {vehicleId, data} |
|
|
@ -2754,7 +2752,7 @@ function loadEvents() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function say(text) |
|
|
|
function say(text) |
|
|
|
sampAddChatMessage(text,-1) |
|
|
|
sampAddChatMessage(tostring(text),-1) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function write_table_log(key, param, Log) |
|
|
|
function write_table_log(key, param, Log) |
|
|
@ -3980,7 +3978,7 @@ function isVehicleTruckersDelete(table, vehicleId) |
|
|
|
local playerId = -1 |
|
|
|
local playerId = -1 |
|
|
|
local isTrailer = false |
|
|
|
local isTrailer = false |
|
|
|
for k,v in pairs(table) do |
|
|
|
for k,v in pairs(table) do |
|
|
|
if v["trailerData"].vehicleId == vehicleId then |
|
|
|
if v["trailerData"].trailerId == vehicleId then |
|
|
|
result = true |
|
|
|
result = true |
|
|
|
playerId = k |
|
|
|
playerId = k |
|
|
|
isTrailer = true |
|
|
|
isTrailer = true |
|
|
@ -4001,19 +3999,27 @@ function luChecker.vehicleStream(stream, vehicleId, data) |
|
|
|
else |
|
|
|
else |
|
|
|
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 |
|
|
|
|
|
|
|
say("Òðåéëåð èãðîêà óäàëåí") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
say("Ìàøèíà èãðîêà óäàëåíà") |
|
|
|
|
|
|
|
end |
|
|
|
luChecker.truckers[playerId] = nil |
|
|
|
luChecker.truckers[playerId] = nil |
|
|
|
end |
|
|
|
end |
|
|
|
luChecker.vehicles[vehicleId] = nil |
|
|
|
luChecker.vehicles[vehicleId] = nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function luChecker.vehicleSync(vehicleId, data) |
|
|
|
function luChecker.vehicleSync(playerId, vehicleId, data) |
|
|
|
if not isPlayerHaveTruckHUD(data.playerId) then |
|
|
|
if luChecker.vehicles[vehicleId] ~= nil and not isPlayerHaveTruckHUD(playerId) then |
|
|
|
if luChecker.vehicles[vehicleId] ~= nil and (luChecker.vehicles[vehicleId].type == 403 or luChecker.vehicles[vehicleId].type == 514 or luChecker.vehicles[vehicleId].type == 515) then |
|
|
|
if luChecker.vehicles[vehicleId] ~= nil and (luChecker.vehicles[vehicleId].type == 403 or luChecker.vehicles[vehicleId].type == 514 or luChecker.vehicles[vehicleId].type == 515) then |
|
|
|
luChecker.truckers[data.playerId] = data |
|
|
|
luChecker.truckers[playerId] = data |
|
|
|
luChecker.truckers[data.playerId]["trailerData"] = { |
|
|
|
luChecker.truckers[playerId]["vehicleId"] = vehicleId |
|
|
|
trailerId = -1 |
|
|
|
if luChecker.truckers[playerId]["trailerData"] == nil then |
|
|
|
} |
|
|
|
luChecker.truckers[playerId]["trailerData"] = { |
|
|
|
|
|
|
|
trailerId = -1 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|