-[A]bu'Ya[S]eR,#! Posted November 1, 2013 Share Posted November 1, 2013 Hello , How can I block people who use color codes as a name from connecting to my server? I tried to do it for every single color code but it will take for ever to list all of them So can anyone tell me how can I solve this? Link to comment
csiguusz Posted November 1, 2013 Share Posted November 1, 2013 Don't want to list all color codes... do it with a pattern: function connect ( name ) if name:find ( "#%x%x%x%x%x%x" ) then cancelEvent ( true, "no colorcodes!" ) end end addEventHandler ( "onPlayerConnect", root, connect ) Link to comment
-[A]bu'Ya[S]eR,#! Posted November 1, 2013 Author Share Posted November 1, 2013 This will not allow people to use color codes at all I want to block connecting the the player name is a color code only ( people do it to make their names invisable ) Link to comment
3NAD Posted November 1, 2013 Share Posted November 1, 2013 function connect ( name ) if name:gsub ( "#%x%x%x%x%x%x", "" ) == "" then cancelEvent ( true, "Invisible name." ) end end addEventHandler ( "onPlayerConnect", root, connect ) 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