Jump to content

how to disable short nicks.


killingyasoon

Recommended Posts

On 02/09/2018 at 05:25, Simple01 said:

// SERVER

function nickHandler( playerNick )
	if ( playerNick and ( #playerNick <= 3 ) ) then
    	// DO SOMETHING
     	cancelEvent() // KICK
    end
end

addEventHandler( 'onPlayerConnect', root, nickHandler )

 

Way to reinvent how Lua comments are supposed to be.

  • Haha 1
Link to post
function nickHandler(playerNick) 
  if (playerNick) and string.len(playerNick) <=3 then
    cancelEvent(true, "Your nickname is too short for that") 
  end
end 
addEventHandler("onPlayerConnect", root, nickHandler) 

 

Edited by Dimos7
Link to post
2 hours ago, Dimos7 said:

function nickHandler(playerNick) 
  if (playerNick) and string.len(playerNick) <=3 then
    cancelEvent(true, "Your nickname is too short for that") 
  end
end 
addEventHandler("onPlayerConnect", root, nickHandler) 

 

Works totally perfect, thank you bud.

Link to post

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