Jump to content

Admin - Messages without HEX codes, how?


MIKI785

Recommended Posts

Hello,

How to remove HEX codes in nick from chatbox messages sent by Admin resource? I couldn't find the function which send all the messages in the code.

I mean, like: "Someone has been muted by #FF0000miki_cz (x secs)" and i want it to be: "Someone has been muted by miki_cz (x secs)"

Link to comment
Hello,

How to remove HEX codes in nick from chatbox messages sent by Admin resource? I couldn't find the function which send all the messages in the code.

I mean, like: "Someone has been muted by #FF0000miki_cz (x secs)" and i want it to be: "Someone has been muted by miki_cz (x secs)"

admin/conf/messages.xml

example:

<group action="ban" r="255" g="0" b="0"> 

change to

<group action="ban" r="0" g="0" b="0"> 

Link to comment

Spanish4Life, that'll change the R, G, B color, it'll not remove the HEX colors.

In admin_server.lua there's a function called: aAction

Replace it with this one:

function aAction ( type, action, admin, player, data, more ) 
    if ( aLogMessages[type] ) then 
        function aStripString ( string ) 
            string = tostring ( string ) 
            string = string.gsub ( string, "$admin", getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin )    and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$data2", more or "" ) 
            if ( player ) then string = string.gsub ( string, "$player", getPlayerName ( player ):gsub("#%x%x%x%x%x%x","") ) end 
            return tostring ( string.gsub ( string, "$data", data or "" ) ) 
        end 
        local node = aLogMessages[type][action] 
        if ( node ) then 
            local r, g, b = node["r"], node["g"], node["b"] 
            if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end 
            if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b ) end 
            if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b ) end 
            if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end 
        end 
    end 
end 

Link to comment
function aAction ( type, action, admin, player, data, more ) 
    if ( aLogMessages[type] ) then 
        function aStripString ( string ) 
            string = tostring ( string ) 
            string = string.gsub ( string, "$admin", getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin )    and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) 
            string = string.gsub ( string, "$data2", more or "" ) 
            if ( player ) then string = string.gsub ( string, "$player", getPlayerName ( player ) ) string = string:gsub("#%x%x%x%x%x%x","") end 
            return tostring ( string.gsub ( string, "$data", data or "" ) ) 
        end 
        local node = aLogMessages[type][action] 
        if ( node ) then 
            local r, g, b = node["r"], node["g"], node["b"] 
            if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end 
            if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b ) end 
            if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b ) end 
            if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end 
        end 
    end 
end 

Fixed.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...