1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00
* команды для САО
This commit is contained in:
Hellss
2021-08-04 11:58:48 +03:00
committed by GitHub
parent 245a482ccc
commit 0d4f3f97d9
3 changed files with 35 additions and 4 deletions

View File

@@ -173,6 +173,18 @@ function MSignalSayHook(ply, comm, fromULX)
if comm[1] == sig.Name then
sig.InvationSignal = false
end
elseif comm:sub(1,7) == "!senao " then
comm = comm:sub(8,-1):upper()
comm = string.Explode(":",comm)
if comm[1] == sig.Name then
if sig.AODisabled then sig.AODisabled = false end
end
elseif comm:sub(1,8) == "!sdisao " then
comm = comm:sub(9,-1):upper()
comm = string.Explode(":",comm)
if comm[1] == sig.Name then
if sig.ARSSpeedLimit == 2 then sig.AODisabled = true end
end
end
end
end
@@ -369,6 +381,7 @@ function ENT:CheckOccupation()
end
if self.OccupiedByNowOld ~= self.OccupiedByNow then
self.InvationSignal = false
self.AODisabled = false
self.OccupiedByNowOld = self.OccupiedByNow
end
else
@@ -414,6 +427,7 @@ function ENT:ARSLogic(tim)
end
if self.OldRoute ~= self.Route then
self.InvationSignal = false
self.AODisabled = false
self.OldRoute = self.Route
end
--Removing NSL
@@ -469,7 +483,8 @@ function ENT:ARSLogic(tim)
local ARSCodes = self.Routes[self.Route].ARSCodes
self.ARSNextSpeedLimit = IsValid(self.NextSignalLink) and self.NextSignalLink.ARSSpeedLimit or tonumber(ARSCodes[1])
self.ARSSpeedLimit = tonumber(ARSCodes[math.min(#ARSCodes, self.FreeBS+1)]) or 0
if self.InvationSignal and self.ARSSpeedLimit == 2 then self.ARSSpeedLimit = 1 end
if self.AODisabled and self.ARSSpeedLimit ~= 2 then self.AODisabled = false end
if (self.InvationSignal or self.AODisabled) and self.ARSSpeedLimit == 2 then self.ARSSpeedLimit = 1 end
end
end
if self.NextSignalLink ~= false and (self.Occupied or not self.NextSignalLink or not self.NextSignalLink.FreeBS) then

View File

@@ -553,3 +553,19 @@ local sclps = ulx.command( CATEGORY_NAME, "ulx sclps", ulx.sclps, "!sclps" )
sclps:addParam{ type=ULib.cmds.StringArg, hint="Signal or route name", ULib.cmds.takeRestOfLine }
sclps:defaultAccess( ULib.ACCESS_ALL )
sclps:help( "Close invitation signal" )
function ulx.senao( calling_ply, arg )
MSignalSayHook(calling_ply,"!senao "..arg, true)
end
local senao = ulx.command( CATEGORY_NAME, "ulx senao", ulx.senao, "!senao" )
senao:addParam{ type=ULib.cmds.StringArg, hint="Signal", ULib.cmds.takeRestOfLine }
senao:defaultAccess( ULib.ACCESS_ALL )
senao:help( "Enable absolute stop signal" )
function ulx.sdisao( calling_ply, arg )
MSignalSayHook(calling_ply,"!sdisao "..arg, true)
end
local sdisao = ulx.command( CATEGORY_NAME, "ulx sdisao", ulx.sdisao, "!sdisao" )
sdisao:addParam{ type=ULib.cmds.StringArg, hint="Signal", ULib.cmds.takeRestOfLine }
sdisao:defaultAccess( ULib.ACCESS_ALL )
sdisao:help( "Disable absolute stop signal" )

View File

@@ -782,8 +782,8 @@ function TOOL:BuildCPanelCustom()
tool:SendSettings()
tool:BuildCPanelCustom()
end
local VPassOccC = CPanel:CheckBox("Pass occupation singal")
VPassOccC:SetTooltip("Pass occupation singal")
local VPassOccC = CPanel:CheckBox("Pass occupation signal")
VPassOccC:SetTooltip("Pass occupation signal")
VPassOccC:SetValue(tool.Signal.PassOcc or false)
function VPassOccC:OnChange()
tool.Signal.PassOcc = self:GetChecked()