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?

~*|| [3.T] Arabs Turbo |KSA| تيربو العرب للهجوله ||*~

Untitled_1.png

_________________________________________________________________________

560x95_CCCCCC_FF0000_000000_000000.png
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 ) 

Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003

Posted

This will not allow people to use color codes at all :S

I want to block connecting the the player name is a color code only ( people do it to make their names invisable )

~*|| [3.T] Arabs Turbo |KSA| تيربو العرب للهجوله ||*~

Untitled_1.png

_________________________________________________________________________

560x95_CCCCCC_FF0000_000000_000000.png
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...