Jump to content

How to setPlayerNick to Registered Nick?


Recommended Posts

function setNickToAccount()
  local account = getPlayerAccount(source)
  local accountName = getAccountName(account)
  setPlayerName(source, accountName)
end
addEventHandler("onPlayerLogin", setNickToAccount)

Put this in any script and you should have the result expected.

Edited by Galactix
  • Like 1
Link to comment
44 minutes ago, Galactix said:

function setNickToAccount
  local account= getPlayerAccount(source)
  local accountName = getAccountName(account)
  setPlayerName(source, accountName)
end
addEventHandler("onPlayerLogin", getRootElement(), setNickToAccount)

Put this in any script and you should have the result expected.

expected near local error


function setNickToAccount
    local account = getPlayerAccount(source)
    local accountName = getAccountName(account)
    setPlayerName(source, accountName)
  end
  addEventHandler("onPlayerLogin", getRootElement(), setNickToAccount)
 
  addEventHandler("onPlayerChangeNick", getRootElement(), 
    function() 
        cancelEvent(); 
    end 
);

also it is whole the code

Edited by Ted Claberling
Link to comment
14 minutes ago, Galactix said:

function setNickToAccount()
  local account = getPlayerAccount(source)
  local accountName = getAccountName(account)
  setPlayerName(source, accountName)
end
addEventHandler("onPlayerLogin", setNickToAccount)

 

Bad Arugment Error

Edited by Ted Claberling
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...