PLUGIN.name = "LVS Vehicles System" PLUGIN.author = "RefoselDev" PLUGIN.description = "Система вызова LVS техники за очки" ix.util.Include("sh_config.lua", "shared") ix.util.Include("cl_plugin.lua", "client") ix.util.Include("sv_plugin.lua", "server") -- Функция проверки активной техники function PLUGIN:HasActiveVehicle(vehicleID, vehicleType) local ply = LocalPlayer() if not IsValid(ply) then return false end -- Ищем активную технику игрока for _, ent in pairs(ents.GetAll()) do if IsValid(ent) and ent.lvsVehicleInfo then local info = ent.lvsVehicleInfo if info.vehicleID == vehicleID and info.vehicleType == vehicleType then -- Проверяем владельца или права админа if ply:IsAdmin() or ply:SteamID() == info.ownerSteamID then return true end end end -- fallback: проверим NWVars если lvsVehicleInfo ещё не синхронизировалось if IsValid(ent) then local nwOwner = ent:GetNWString("LVS_OwnerSteamID", "") local nwID = ent:GetNWString("LVS_VehicleID", "") local nwType = ent:GetNWString("LVS_VehicleType", "") if nwID == tostring(vehicleID) and nwType == tostring(vehicleType) and nwOwner ~= "" then if ply:IsAdmin() or ply:SteamID() == nwOwner then return true end end end end return false end