diff --git a/lua/entities/gmod_track_signal/init.lua b/lua/entities/gmod_track_signal/init.lua index bca3d5f..efae1c7 100644 --- a/lua/entities/gmod_track_signal/init.lua +++ b/lua/entities/gmod_track_signal/init.lua @@ -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 diff --git a/lua/ulx/modules/sh/metrostroi.lua b/lua/ulx/modules/sh/metrostroi.lua index ca6e592..9a81600 100644 --- a/lua/ulx/modules/sh/metrostroi.lua +++ b/lua/ulx/modules/sh/metrostroi.lua @@ -552,4 +552,20 @@ end 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" ) \ No newline at end of file +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" ) \ No newline at end of file diff --git a/lua/weapons/gmod_tool/stools/signalling.lua b/lua/weapons/gmod_tool/stools/signalling.lua index b58ff6d..ff8f9a7 100644 --- a/lua/weapons/gmod_tool/stools/signalling.lua +++ b/lua/weapons/gmod_tool/stools/signalling.lua @@ -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()