• Silent Commands stuck
    0 replies, posted
As a joke I thounght I would disable echos for my Admin powers and mess with people.I know you can do this through the Ulx menu, but I did a different method.I regret it. I did what this dude said Why Are You Talking Like This? Anyway, ulx/lua/ulx/log.lua: [CODE]// Code above // line 88 function ulx.logServAct( ply, action, hide_echo ) local nick if ply:IsValid() then if not ply:IsConnected() then return end nick = ply:Nick() else nick = "(Console)" end local level = GetConVarNumber( "ulx_logEcho" ) if not hide_echo and level > 0 then local echo if level == 1 then echo = action:gsub( "#A", "(ADMIN)", 1 ) elseif level == 2 then echo = action:gsub( "#A", "(ADMIN) " .. nick, 1 ) end ULib.tsay( _, echo, true ) elseif level > 0 then local echo = action:gsub( "#A", "(SILENT)(ADMIN) " .. nick, 1 ) ULib.tsay( ply, echo, true ) -- Whether or not the originating player has access, they're getting the echo. local players = player.GetAll() for _, player in ipairs( players ) do if ULib.ucl.query( player, hiddenechoAccess ) and player ~= ply then ULib.tsay( player, echo, true ) end end end if isDedicatedServer() then Msg( action:gsub( "#A", "(ADMIN) " .. nick, 1 ) .. "\n" ) end if util.tobool( GetConVarNumber( "ulx_logFile" ) ) then ulx.logString( action:gsub( "#A", "(ADMIN) " .. nick, 1 ) ) end end // line 128 // Code below[/CODE] If you replace that chunk with this one then only admins should be able to see the text or maybe I'm just retarded and you can use that ulx_logEcho cvar. [CODE]function ulx.logServAct( ply, action, hide_echo ) local nick if ply:IsValid() then if not ply:IsConnected() then return end nick = ply:Nick() else nick = "(Console)" end local level = GetConVarNumber( "ulx_logEcho" ) if level > 0 then local echo = action:gsub( "#A", "(SILENT)(ADMIN) " .. nick, 1 ) ULib.tsay( ply, echo, true ) -- Whether or not the originating player has access, they're getting the echo. local players = player.GetAll() for _, player in ipairs( players ) do if ULib.ucl.query( player, hiddenechoAccess ) and player ~= ply then ULib.tsay( player, echo, true ) end end end[/CODE] if isDedicatedServer() then Msg( action:gsub( "#A", "(ADMIN) " .. nick, 1 ) .. "\n" ) end if util.tobool( GetConVarNumber( "ulx_logFile" ) ) then ulx.logString( action:gsub( "#A", "(ADMIN) " .. nick, 1 ) ) end end Works well,but can't get echos back.Help please!
Sorry, you need to Log In to post a reply to this thread.