Jump to content

[HELP] MY CODE IS NOT WORKING


KainDepZai

Recommended Posts

function nick (account, source) 
    local name = getPlayerName ( source ) 
    local account = getAccountName () 
    if ( name ) then  
        if getElementType ( name ) == "player" then 
        local oldName = getPlayerName ( name ) 
                setPlayerName ( name, account ) 
            outputChatBox("Your character name is" ..account.. "!") 
        end 
        else 
    end 
end 
addEventHandler("onPlayerLogin", root, nick) 

please check and help me, i want to set player nick = account player register

sorry for my english

Link to comment
addEventHandler ( "onPlayerLogin", getRootElement ( ), 
    function ( _, theCurrentAccount ) 
        setPlayerName ( source, getAccountName ( theCurrentAccount ) ) 
    end 
) 
  
addEventHandler ( "onPlayerChangeNick", getRootElement ( ), 
    function ( ) 
      cancelEvent() 
    end 
) 
  

lua]

Link to comment

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