waleedrt Posted June 14, 2016 Share Posted June 14, 2016 how do i remove the player color code on player join ? Link to comment
Noki Posted June 14, 2016 Share Posted June 14, 2016 Here is a snippet of some old code from CSG. It checks for hex, and if a player's name is just hex (which some people do, I don't know why), it will assign them a random name. -- Remove hex function removeHEX(oldNick, newNick) local name = getPlayerName(source) if newNick then name = newNick end if name:find("#%x%x%x%x%x%x") then local name = name:gsub("#%x%x%x%x%x%x","") if name:len() > 0 then setPlayerName(source, name) else setPlayerName(source, "Player"..tostring(math.random(10000,99990))) end if newNick then cancelEvent() end end end addEventHandler("onPlayerJoin", root, removeHEX) addEventHandler("onPlayerChangeNick", root, removeHEX) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now