Jump to content

Login Account Name


Karuzo

Recommended Posts

Posted

Hey Guys,

i need some help,

is there a way to get the Account Name of the Player and set it to his Nickname ?

and if he wants to change his nick cancel it ?

Posted

Yes, it is.

getPlayerAccount 
getAccountName 
setPlayerName 

To stop the player from changing his name use: cancelEvent with the event onPlayerChangeNick.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • MTA Team
Posted

Not Tested:

  
addEventHandler ( 'onPlayerLogin', root, 
    function ( _, theCurrentAccount ) 
    local acc = getAccountName(theCurrentAccount) 
    setPlayerName ( source, acc ) 
end 
) 
function nickChangeHandler() 
        cancelEvent() 
end 
addEventHandler("onPlayerChangeNick", root, nickChangeHandler) 

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
  • MTA Team
Posted

XML functions maybe the best.

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
  • MTA Team
Posted

With account functions you mean setAccountData?

Well that's maybe posible with:

  
--Storing a serial with 
setAccountData 
--Then on join use 
getAccounts--This will get a list of all accounts on the server 
--Then you can use 
getAccountData--To retrive the serial saved on that account 
  

Easier is XML functions tho.

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
  • MTA Team
Posted

You're Welcome.

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 

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