Дата: Понедельник, 10.07.2017, 22:05 | Сообщение # 46
Глава районной администрации
Группа: V.I.P.
Сообщений: 1112
ЦитатаRoad_Runner ()
Намного проще скопипастить текст скрипта и сохранить его как "*.lua", чем лопатить десятки карт в поисках нужного.
Вряд-ли проще, на сайтах он выложен как текст - строки пронумерованы, строк этих может быть несколько сотен, убирать начало строчек (номера) - то ещё мозгоклюйство! Да и не будет тот скрипт из МОДа работать - он написан так что только из ресурсов игры работает, его надо переделывать чтобы из МОДа-модельки работал!
строки пронумерованы, строк этих может быть несколько сотен, убирать начало строчек (номера) - то ещё мозгоклюйство!
В Notepad++ через функцию "Заменить" и режим поиска "Регулярные выражения" - все эти номерки фиксятся в течении минуты. Ищешь текст ^.* с заменой на пустое поле. (после * табуляция, скопируй её из текста и вставь после звездочки)
Сообщение отредактировал jenya_it - Вторник, 11.07.2017, 14:32
Всем привет, подскажите в чем проблема, пытаюсь распаковать dlc и gar пишет такое ..."скрипт попросил загрузить функцию из dll ФАЙЛ ПАМЯТИ Вы хотите продолжать"... (перевод google) и дальше ничего не происходит, ФС13 распаковывает все, а 15 и 17 не хочет. ?
Сообщение отредактировал Ден555 - Суббота, 24.03.2018, 19:38
Wheaten, platinumEdition и dataS, dataS2, да я уже 5 раз скачал с разных источников и все они, один и тот же 0.3.2a Мне кажется это у меня на компе так, у других ломается все) Может мне кто нибудь, скинет уже в zip если не затруднит?
Сообщение отредактировал Ден555 - Суббота, 24.03.2018, 22:17
Кто-нибудь знает как добраться скриптами до игрового времени? Делаю зону, в которой за час будут снимать N сумму. Уже все прописал, осталось только закрепить это за игровыми часами. Пока тестировал на простеньком таймере
Добавлено (15.08.2018, 21:46) --------------------------------------------- Почему то не могу свой вопрос изменить. Пишу новый. На GDN нашел вот такое, уже давно там висит. Они как то через редактор используют игровой движок(как я понял) и так делать отладку скриптов куда проще, особенно если это скрипт на интерфейс. Никто не знает что и как там запускать?
Ребята, где взять скрипт на телепорт техники из точки А в точку Б? То есть чтобы при наезде на триггер тебя перекидывало в другое место.
Добавлено (04.01.2021, 19:06) --------------------------------------------- Ребята, всех с Новым Годом! Кто подскажет, где чего изменить в коде курсплея, чтобы он распостранялся и на поезда???
Добавлено (06.01.2021, 14:51) --------------------------------------------- Помогите пожалуйста создать скрипт на остановку трафик-поезда перед препятствиями. Вот есть рабочий скрипт но без остановок
_G.PathTrains = PathTrains; function PathTrains.onCreate(id) if _G.trains == nil then _G.trains = {}; end; table.insert(_G.trains, Train:new(id)); end;
function PathTrains:update(dt) if _G.trains ~= nil then for k,v in pairs(_G.trains) do v:update(dt); end; end; end;
function PathTrains:delete() _G.trains = nil; end; function PathTrains:loadMap(name) end; function PathTrains:deleteMap() _G.trains = nil; end; function PathTrains:mouseEvent(posX, posY, isDown, isUp, button) end; function PathTrains:keyEvent(unicode, sym, modifier, isDown) end; function PathTrains:draw() end;
Train = {}; local Train_mt = Class(Train); g_universalTipTriggerDir = g_currentModDirectory;
function Train:new(id, customMt) local instance = {}; if customMt ~= nil then setmetatable(instance, customMt); else setmetatable(instance, Train_mt); end;
local spline = getUserAttribute(id, "spline"); local trainobj = getUserAttribute(id, "train"); local trainid = Utils.indexToObject(id,trainobj); instance.spline = Utils.indexToObject(id,spline); local length = getSplineLength(instance.spline);
instance.trainGroup = {}; instance.positions = {}; local numOfParts = getNumOfChildren(trainid); if numOfParts > 0 then for c=1, numOfParts do local trainpart = getChildAt(trainid,c-1); table.insert(instance.trainGroup, trainpart ); local x,y,z = getTranslation(trainpart); local delay = -z/length; table.insert(instance.positions, delay); end; end;
function TrafficTrain:delete() if g_currentMission.environment then g_currentMission.environment:removeWeatherChangeListener(self); end; g_currentMission:removeUpdateable(self); end;
function TrafficTrain:weatherChanged() if self.locomotive and not self.locomotive.isDeleted then setVisibility(self.locomotive.nightLights, not g_currentMission.environment.isSunOn); end; end;
function TrafficTrain:update(dt) if self.updateBrakePercent then if self.locomotive then if self.brakeState == 1 then RailroadSound:playSound(Railroad.trafficSounds.brakeAirSystem); self.brakePercent = math.min(self.brakePercent + 0.001*dt, 1); local volume = math.min(self.brakePercent, SoundUtil.indoorSoundIsActive and Railroad.trafficSounds.brakeAirSystem.indoorVolume or 1); RailroadSound:setSampleVolume(Railroad.trafficSounds.brakeAirSystem, volume); self.updateBrakePercent = self.brakePercent~=1; else self.brakePercent = math.max(self.brakePercent - 0.001*dt, 0); RailroadSound:playSound(Railroad.trafficSounds.brakeAirSystem); local volume = math.min(self.brakePercent, SoundUtil.indoorSoundIsActive and Railroad.trafficSounds.brakeAirSystem.indoorVolume or 1); RailroadSound:setSampleVolume(Railroad.trafficSounds.brakeAirSystem, volume); if self.brakePercent == 0 then self.updateBrakePercent = false; RailroadSound:stopSound(Railroad.trafficSounds.brakeAirSystem); RailroadSound:stopSound(RailroadSound.brakeSound); end; end; else self.updateBrakePercent = false; RailroadSound:stopSound(Railroad.trafficSounds.brakeAirSystem); RailroadSound:stopSound(RailroadSound.brakeSound); end; end; if self.brakePercent > 0 then local x,y,z = getWorldTranslation(self.locomotive.rootNode); setTranslation(Railroad.trafficSounds.brakeAirSystem.sound, x,y,z); end; if g_server then if not Railroad.activeTrafficPath then return; end; local firstVehicle = self.vehicleChain[1]; if not firstVehicle then Railroad:removeTrafficTrain(); g_server:broadcastEvent(RemoveTrafficTrainEvent:new()); return; end; local brakePercent = 0; local brakeWay = ((self.speed*0.28)^2)/(self.brakeForce*0.56)+5; local x,y,z = getWorldTranslation(firstVehicle.frontCouple.attacher); local target, distance = self:getTarget(x,y,z); local nearestVehicle, disToVehicle = self:getNearestTrainVehicle(x,y,z); if nearestVehicle then brakePercent = self:getBrakePercent(brakeWay, disToVehicle, brakePercent); end; if target then brakePercent = self:getBrakePercent(brakeWay, distance, brakePercent); end; if self.stopPoint then local x1,_,z1 = getWorldTranslation(self.stopPoint); distance = Utils.vector2Length(x1-x, z1-z)+6; brakePercent = self:getBrakePercent(brakeWay, distance, brakePercent); end; if self.speed > 0 then local spline, splineLength = firstVehicle:getSpline(1); if #self.splines == 1 then if splineLength < 15 and self.locomotive then self.locomotive = nil; end; if splineLength < 5 then firstVehicle:detachAllVehicles(); table.remove(self.vehicleChain, 1); self.vehicles [firstVehicle]= nil; g_server:broadcastEvent(RemoveTrafficTrainEvent:new(firstVehicle)); firstVehicle:delete(); Railroad:updateVehiclesOnSplines(); firstVehicle = self.vehicleChain[1]; if not firstVehicle then return; end; end; end; self.lastSpline = Utils.getNoNil(self.lastSpline, self.splines[1]); if spline.node ~= self.lastSpline then if #self.splines > 1 then table.remove(self.splines, 1); end; self.lastSpline = spline.node; end; end; local accelerationFactor = (self.speed >= self.maxSpeed or brakePercent > 0) and 0 or self.acceleration; self.speed = math.max(self.speed+0.001*dt*accelerationFactor-0.001*dt*self.brakeForce*brakePercent, 0); if self.lastSpeed == 0 and self.speed > 0 then self:onStart(); end; if self.lastSpeed > 0 and self.speed == 0 then self:onStop(); if target then Economy:updateStat("railroadPenalty", 1); g_currentMission:showBlinkingWarning(g_i18n:getText("message_trainStanding"), 3000); elseif self.stopPoint then local nextPaths = Railroad.activeTrafficPath.nextPaths; Railroad.nextTrafficPath = nextPaths[math.random(1, #nextPaths)]; Railroad:stopTrafficPath(); self.parkingTimer = 60; self.stopPoint = nil; end; g_server:broadcastEvent(TrafficTrainSpeedEvent:new(0)); end; self.lastSpeed = self.speed; if self.speed > 0.01 then local movement = self.speed*0.00028*dt; firstVehicle:updatePosition(movement, 1); local couple = firstVehicle.backCouple; local attachedVehicle = couple.attachedVehicle; if attachedVehicle then attachedVehicle:updatePosition(movement, 1, couple, couple.attachedCouple); end; self.brakeState = brakePercent > 0 and 1 or 0; if self.brakeState ~= self.lastBrakeState then self.updateBrakePercent = true; self.lastBrakeState = self.brakeState; g_server:broadcastEvent(TrafficTrainVehicleBrakeEvent:new(self.brakeState)); end; local fspeed = math.floor(self.speed); if fspeed ~= self.sendSpeed then self.sendSpeed = fspeed; g_server:broadcastEvent(TrafficTrainSpeedEvent:new(fspeed)); end; end; if target then if self.locomotive then self.hornTimer = self.hornTimer + dt; if self.hornTimer > 5000 then self:playHorn("horn"); self.hornTimer = 0; if self.speed == 0 then g_currentMission:showBlinkingWarning(g_i18n:getText("message_trainStanding"), 3000); end; g_server:broadcastEvent(TrafficHornEvent:new(self.speed == 0)); end; if self.speed == 0 then local money = -dt*0.1; g_currentMission:addSharedMoney(money, "other"); g_currentMission:addMoneyChange(money, self.moneyChangeId); self.lastMoneyChange = 30; end; end; end; if self.lastMoneyChange > 0 then self.lastMoneyChange = self.lastMoneyChange - 1; if self.lastMoneyChange == 0 then g_currentMission:showMoneyChange(self.moneyChangeId, g_i18n:getText("finance_penalties")); end; end; end; end;
function TrafficTrain:getBrakePercent(brakeWay, distance, brakePercent) if distance > 0 then local percent = brakeWay/distance; if percent >= 0.5 then return math.max(brakePercent, percent); end; end; return brakePercent; end;
function TrafficTrain:onStart() RailroadSound:playAttachedCouplesSound(self.vehicles); self:playHorn("horn"); if g_server then g_server:broadcastEvent(StartStopTrafficEvent:new(true)); end; end;
function TrafficTrain:onStop() RailroadSound:playAttachedCouplesSound(self.vehicles); self.updateBrakePercent = true; self.lastBrakeState = 0; self.brakeState = 0; if g_server then g_server:broadcastEvent(StartStopTrafficEvent:new(false)); end; end;
function TrafficTrain:getNearestTrainVehicle(x,y,z) for i=1, #self.splines do local spline = self.splines; if getTableLenght(Railroad.vehiclesOnSpline[spline]) > 0 then local distance = math.huge; local nearestVehicle; for _,vehicle in pairs(Railroad.vehiclesOnSpline[spline]) do if not self.vehicles [vehicle]then for _,couple in pairs(vehicle.couples) do if not couple.attachedVehicle then local x1,_,z1 = getWorldTranslation(couple.attacher); local currentDistance = Utils.vector2Length(x1-x, z1-z); if currentDistance < distance then distance = currentDistance; nearestVehicle = vehicle; end; end; end; end; end; if nearestVehicle then return nearestVehicle, distance; end; end; end; end;
function TrafficTrain:getTarget(x,y,z) if self.locomotive then local splines = {self.splines[1]}; local _, splineLength = self.locomotive:getSpline(1); if #self.splines > 1 and splineLength < 200 then local i=2; while true do local spline = self.splines; table.insert(splines, spline); splineLength = splineLength + Railroad.splineLengths[spline]; if splineLength >= 200 or not self.splines[i+1] then break; end; i=i+1; end; end; local targets, nearestTargets = {}, {}; for i=1, #g_currentMission.vehicles do targets = g_currentMission.vehicles.rootNode; end; for _,player in pairs(g_currentMission.players) do if player.isControlled then table.insert(targets, player.rootNode); end; end; for i=1, #targets do local target = targets; local tx,ty,tz = getWorldTranslation(target); local distance = Utils.vector3Length(x-tx, y-ty, z-tz); if distance < 200 then local lx,ly,lz = worldToLocal(self.locomotive.rootNode, tx,ty,tz); if lz < 0 and math.abs(ly) < 4 and math.abs(lx) < 15 then for j=1, #splines do local spline = splines
; local length = Railroad.splineLengths[spline]; for p=1, math.floor(length) do local px,py,pz = getSplinePosition(spline, p/length); local disToTrack = Utils.vector3Length(px-tx, py-ty, pz-tz); if disToTrack < 2 then table.insert(nearestTargets, target); end; end; end; end; end; end; if #nearestTargets > 0 then local nearestTarget; local distance = math.huge; for i=1, #nearestTargets do local target = nearestTargets; local tx,ty,tz = getWorldTranslation(target); local currentDistance = Utils.vector3Length(x-tx, y-ty, z-tz); if currentDistance < distance then distance = currentDistance; nearestTarget = target; end; end; if nearestTarget then return nearestTarget, distance; end; end; end; end;
function TrafficTrain:setMarkerAction(action, stopPoint) if action == "horn" or action == "whistle" then self:playHorn(action); elseif action == "stop" then self.stopPoint = stopPoint; end; end;
function TrafficTrain:playHorn(name) if self.locomotive then Railroad.trafficSounds[name].activeVolume = SoundUtil.indoorSoundIsActive and 0.5 or 1; RailroadSound:playSound(Railroad.trafficSounds[name], self.locomotive.rootNode); end; end;
Добавлено (06.01.2021, 14:54) --------------------------------------------- а этот вроде с остановкамиКод--author: igor29381TrafficTrain = {};function TrafficTrain.onCreate(id) local object = TrafficTrain:new(g_server ~= nil, g_client ~= nil) if object:load(id) then g_currentMission:addOnCreateLoadedObject(object) object:register(true) else object:delete() end;end;function TrafficTrain:new() local self = {speed=0, lastSpeed=0, sendSpeed=0, brakeState=0, lastBrakeState=0, brakePercent=0, hornTimer=0, parkingTimer=0, updateBrakePercent=false}; setmetatable(self, Class(TrafficTrain)); g_currentMission:addUpdateable(self); self.vehicles = {}; self.vehicleChain = {}; self.lastMarkers = {}; self.lastMoneyChange = 0; self.moneyChangeId = getMoneyTypeId(); return self;end;function TrafficTrain:loadData(locomotive) self.locomotive = locomotive; self.maxSpeed = self.locomotive.maxSpeed; self.acceleration = self.locomotive.acceleration; self.brakeForce = self.locomotive.brakeForce; g_currentMission.environment:addWeatherChangeListener(self);end;function TrafficTrain:delete() if g_currentMission.environment then g_currentMission.environment:removeWeatherChangeListener(self); end; g_currentMission:removeUpdateable(self);end;function TrafficTrain:weatherChanged() if self.locomotive and not self.locomotive.isDeleted then setVisibility(self.locomotive.nightLights, not g_currentMission.environment.isSunOn); end;end;function TrafficTrain:update(dt) if self.updateBrakePercent then if self.locomotive then if self.brakeState == 1 then RailroadSound:playSound(Railroad.trafficSounds.brakeAirSystem); self.brakePercent = math.min(self.brakePercent + 0.001*dt, 1); local volume = math.min(self.brakePercent, SoundUtil.indoorSoundIsActive and Railroad.trafficSounds.brakeAirSystem.indoorVolume or 1); RailroadSound:setSampleVolume(Railroad.trafficSounds.brakeAirSystem, volume); self.updateBrakePercent = self.brakePercent~=1; else self.brakePercent = math.max(self.brakePercent - 0.001*dt, 0); RailroadSound:playSound(Railroad.trafficSounds.brakeAirSystem); local volume = math.min(self.brakePercent, SoundUtil.indoorSoundIsActive and Railroad.trafficSounds.brakeAirSystem.indoorVolume or 1); RailroadSound:setSampleVolume(Railroad.trafficSounds.brakeAirSystem, volume); if self.brakePercent == 0 then self.updateBrakePercent = false; RailroadSound:stopSound(Railroad.trafficSounds.brakeAirSystem); RailroadSound:stopSound(RailroadSound.brakeSound); end; end; else self.updateBrakePercent = false; RailroadSound:stopSound(Railroad.trafficSounds.brakeAirSystem); RailroadSound:stopSound(RailroadSound.brakeSound); end; end; if self.brakePercent > 0 then local x,y,z = getWorldTranslation(self.locomotive.rootNode); setTranslation(Railroad.trafficSounds.brakeAirSystem.sound, x,y,z); end; if g_server then if not Railroad.activeTrafficPath then return; end; local firstVehicle = self.vehicleChain[1]; if not firstVehicle then Railroad:removeTrafficTrain(); g_server:broadcastEvent(RemoveTrafficTrainEvent:new()); return; end; local brakePercent = 0; local brakeWay = ((self.speed*0.28)^2)/(self.brakeForce*0.56)+5; local x,y,z = getWorldTranslation(firstVehicle.frontCouple.attacher); local target, distance = self:getTarget(x,y,z); local nearestVehicle, disToVehicle = self:getNearestTrainVehicle(x,y,z); if nearestVehicle then brakePercent = self:getBrakePercent(brakeWay, disToVehicle, brakePercent); end; if target then brakePercent = self:getBrakePercent(brakeWay, distance, brakePercent); end; if self.stopPoint then local x1,_,z1 = getWorldTranslation(self.stopPoint); distance = Utils.vector2Length(x1-x, z1-z)+6; brakePercent = self:getBrakePercent(brakeWay, distance, brakePercent); end; if self.speed > 0 then local spline, splineLength = firstVehicle:getSpline(1); if #self.splines == 1 then if splineLength < 15 and self.locomotive then self.locomotive = nil; end; if splineLength < 5 then firstVehicle:detachAllVehicles(); table.remove(self.vehicleChain, 1); self.vehicles [firstVehicle]= nil; g_server:broadcastEvent(RemoveTrafficTrainEvent:new(firstVehicle)); firstVehicle:delete(); Railroad:updateVehiclesOnSplines(); firstVehicle = self.vehicleChain[1]; if not firstVehicle then return; end; end; end; self.lastSpline = Utils.getNoNil(self.lastSpline, self.splines[1]); if spline.node ~= self.lastSpline then if #self.splines > 1 then table.remove(self.splines, 1); end; self.lastSpline = spline.node; end; end; local accelerationFactor = (self.speed >= self.maxSpeed or brakePercent > 0) and 0 or self.acceleration; self.speed = math.max(self.speed+0.001*dt*accelerationFactor-0.001*dt*self.brakeForce*brakePercent, 0); if self.lastSpeed == 0 and self.speed > 0 then self:onStart(); end; if self.lastSpeed > 0 and self.speed == 0 then self:onStop(); if target then Economy:updateStat("railroadPenalty", 1); g_currentMission:showBlinkingWarning(g_i18n:getText("message_trainStanding"), 3000); elseif self.stopPoint then local nextPaths = Railroad.activeTrafficPath.nextPaths; Railroad.nextTrafficPath = nextPaths[math.random(1, #nextPaths)]; Railroad:stopTrafficPath(); self.parkingTimer = 60; self.stopPoint = nil; end; g_server:broadcastEvent(TrafficTrainSpeedEvent:new(0)); end; self.lastSpeed = self.speed; if self.speed > 0.01 then local movement = self.speed*0.00028*dt; firstVehicle:updatePosition(movement, 1); local couple = firstVehicle.backCouple; local attachedVehicle = couple.attachedVehicle; if attachedVehicle then attachedVehicle:updatePosition(movement, 1, couple, couple.attachedCouple); end; self.brakeState = brakePercent > 0 and 1 or 0; if self.brakeState ~= self.lastBrakeState then self.updateBrakePercent = true; self.lastBrakeState = self.brakeState; g_server:broadcastEvent(TrafficTrainVehicleBrakeEvent:new(self.brakeState)); end; local fspeed = math.floor(self.speed); if fspeed ~= self.sendSpeed then self.sendSpeed = fspeed; g_server:broadcastEvent(TrafficTrainSpeedEvent:new(fspeed)); end; end; if target then if self.locomotive then self.hornTimer = self.hornTimer + dt; if self.hornTimer > 5000 then self:playHorn("horn"); self.hornTimer = 0; if self.speed == 0 then g_currentMission:showBlinkingWarning(g_i18n:getText("message_trainStanding"), 3000); end; g_server:broadcastEvent(TrafficHornEvent:new(self.speed == 0)); end; if self.speed == 0 then local money = -dt*0.1; g_currentMission:addSharedMoney(money, "other"); g_currentMission:addMoneyChange(money, self.moneyChangeId); self.lastMoneyChange = 30; end; end; end; if self.lastMoneyChange > 0 then self.lastMoneyChange = self.lastMoneyChange - 1; if self.lastMoneyChange == 0 then g_currentMission:showMoneyChange(self.moneyChangeId, g_i18n:getText("finance_penalties")); end; end; end;end;function TrafficTrain:getBrakePercent(brakeWay, distance, brakePercent) if distance > 0 then local percent = brakeWay/distance; if percent >= 0.5 then return math.max(brakePercent, percent); end; end; return brakePercent;end;function TrafficTrain:onStart() RailroadSound:playAttachedCouplesSound(self.vehicles); self:playHorn("horn"); if g_server then g_server:broadcastEvent(StartStopTrafficEvent:new(true)); end;end;function TrafficTrain:onStop() RailroadSound:playAttachedCouplesSound(self.vehicles); self.updateBrakePercent = true; self.lastBrakeState = 0; self.brakeState = 0; if g_server then g_server:broadcastEvent(StartStopTrafficEvent:new(false)); end;end;function TrafficTrain:getNearestTrainVehicle(x,y,z) for i=1, #self.splines do local spline = self.splines; if getTableLenght(Railroad.vehiclesOnSpline[spline]) > 0 then local distance = math.huge; local nearestVehicle; for _,vehicle in pairs(Railroad.vehiclesOnSpline[spline]) do if not self.vehicles [vehicle]then for _,couple in pairs(vehicle.couples) do if not couple.attachedVehicle then local x1,_,z1 = getWorldTranslation(couple.attacher); local currentDistance = Utils.vector2Length(x1-x, z1-z); if currentDistance < distance then distance = currentDistance; nearestVehicle = vehicle; end; end; end; end; end; if nearestVehicle then return nearestVehicle, distance; end; end; end;end;function TrafficTrain:getTarget(x,y,z) if self.locomotive then local splines = {self.splines[1]}; local _, splineLength = self.locomotive:getSpline(1); if #self.splines > 1 and splineLength < 200 then local i=2; while true do local spline = self.splines; table.insert(splines, spline); splineLength = splineLength + Railroad.splineLengths[spline]; if splineLength >= 200 or not self.splines[i+1] then break; end; i=i+1; end; end; local targets, nearestTargets = {}, {}; for i=1, #g_currentMission.vehicles do targets = g_currentMission.vehicles.rootNode; end; for _,player in pairs(g_currentMission.players) do if player.isControlled then table.insert(targets, player.rootNode); end; end; for i=1, #targets do local target = targets; local tx,ty,tz = getWorldTranslation(target); local distance = Utils.vector3Length(x-tx, y-ty, z-tz); if distance < 200 then local lx,ly,lz = worldToLocal(self.locomotive.rootNode, tx,ty,tz); if lz < 0 and math.abs(ly) < 4 and math.abs(lx) < 15 then for j=1, #splines do local spline = splines
; local length = Railroad.splineLengths[spline]; for p=1, math.floor(length) do local px,py,pz = getSplinePosition(spline, p/length); local disToTrack = Utils.vector3Length(px-tx, py-ty, pz-tz); if disToTrack < 2 then table.insert(nearestTargets, target); end; end; end; end; end; end; if #nearestTargets > 0 then local nearestTarget; local distance = math.huge; for i=1, #nearestTargets do local target = nearestTargets; local tx,ty,tz = getWorldTranslation(target); local currentDistance = Utils.vector3Length(x-tx, y-ty, z-tz); if currentDistance < distance then distance = currentDistance; nearestTarget = target; end; end; if nearestTarget then return nearestTarget, distance; end; end; end;end;function TrafficTrain:setMarkerAction(action, stopPoint) if action == "horn" or action == "whistle" then self:playHorn(action); elseif action == "stop" then self.stopPoint = stopPoint; end;end;function TrafficTrain:playHorn(name) if self.locomotive then Railroad.trafficSounds[name].activeVolume = SoundUtil.indoorSoundIsActive and 0.5 or 1; RailroadSound:playSound(Railroad.trafficSounds[name]
, self.locomotive.rootNode); end;end;
Добавлено (06.01.2021, 14:59) --------------------------------------------- НЕ МОГУ ИСПРАВИТЬ пост - КНОПКИ нет, но код правильный
артеммh, на "Дарах" вс е скрипты взаимосвязаны, я уже пробовал оттуда звбрать но не получилось. Там надо все "хором" забирать, но они ещё больше проблем принесут.
артеммh, на "Дарах" вс е скрипты взаимосвязаны, я уже пробовал оттуда звбрать но не получилось. Там надо все "хором" забирать, но они ещё больше проблем принесут.
Всем привет, ищу скрипт на технику. Суть такова... жмешь на клавишу происходит какое либо действие (к примеру выдвигается стрела на половину) ... жмёшь на ту же клавишу второй раз (стрела выдвигается на максимум) ... третий нажим восстанавливает стрелу в исходное положение. Перерыл тонну модификаций на FS17 не чего подобного так и не попалось.