Jump to content

Hide Color Tags


Recommended Posts

Jesseunit, that's off-topic.

This code will remove player HEX color code's from his/her nick when they change their nick or when join the server.

rootElement = getRootElement() 
  
function removeHEXColor(oldNick,newNick) 
    local name = getPlayerName(source) 
    if newNick then 
        name = newNick 
    end 
    if (string.find(name,"#%x%x%x%x%x%x")) then 
        local name = string.gsub(name,"#%x%x%x%x%x%x","") 
        setPlayerName(source,name) 
        if (newNick) then 
        cancelEvent() 
        end 
    end  
end 
addEventHandler("onPlayerJoin",rootElement,removeHEXColor) 
addEventHandler("onPlayerChangeNick",rootElement,removeHEXColor) 

Edited by Guest
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...