Jump to content

onPlayerConnect


Recommended Posts

Posted

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 :S

So can anyone tell me how can I solve this?

Posted

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 ) 

Posted
function connect ( name ) 
    if name:gsub ( "#%x%x%x%x%x%x", "" ) == "" then 
        cancelEvent ( true, "Invisible name." ) 
    end 
end 
addEventHandler ( "onPlayerConnect", root, connect ) 

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...