Jullul7000 Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler( 'onPlayerJoin', root, function( ) local name = getPlayerName( source ) local nick = string.gsub( name, "#%x%x%x%x%x%x", "" ) setPlayerName( source, nick ) end ) How can i change that it works when they change his name Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler("onPlayerChangeNick", root, function( ) local name = getPlayerName( source ) local nick = string.gsub( name, "#%x%x%x%x%x%x", "" ) setPlayerName( source, nick ) end ) i think it,s should to be like that ^ Link to comment
Jullul7000 Posted January 28, 2013 Author Share Posted January 28, 2013 addEventHandler("onPlayerChangeNick", root, function( ) local name = getPlayerName( source ) local nick = string.gsub( name, "#%x%x%x%x%x%x", "" ) setPlayerName( source, nick ) end ) i think it,s should to be like that ^ It spams the chat + doenst work Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 Try This Should To Work And i Think it,s Better To Complete The Script On The First Topic : addEventHandler("onPlayerChangeNick", root, function(old,new) local nick = string.gsub( new, "#%x%x%x%x%x%x", "" ) if nick ~= old then setPlayerName( source, nick ) end end ) Link to comment
3NAD Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler ( "onPlayerJoin", root, function ( ) local name = getPlayerName ( source ) if string.find ( name, "#%x%x%x%x%x%x" ) then local nick = string.gsub ( name, "#%x%x%x%x%x%x", "" ) cancelEvent ( ) setPlayerName ( source, nick ) return end end ) addEventHandler ( "onPlayerChangeNick", root, function ( _, name ) if string.find ( name, "#%x%x%x%x%x%x" ) then local nick = string.gsub ( name, "#%x%x%x%x%x%x", "" ) cancelEvent ( ) setPlayerName ( source, nick ) return end end ) Link to comment
TAPL Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler ( "onPlayerJoin", root, function ( ) local name = getPlayerName ( source ) if string.find ( name, "#%x%x%x%x%x%x" ) then local nick = string.gsub ( name, "#%x%x%x%x%x%x", "" ) cancelEvent ( ) setPlayerName ( source, nick ) return end end ) addEventHandler ( "onPlayerChangeNick", root, function ( _, name ) if string.find ( name, "#%x%x%x%x%x%x" ) then local nick = string.gsub ( name, "#%x%x%x%x%x%x", "" ) cancelEvent ( ) setPlayerName ( source, nick ) return end end ) onPlayerJoin + canclEvent? Nice joke. Link to comment
Kenix Posted January 28, 2013 Share Posted January 28, 2013 Make sure onPlayerQuit + cancelEvent. Nice joke too. Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 Make sure onPlayerQuit + cancelEvent. Nice joke too. No problem all people forget . 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