Karuzo Posted February 14, 2014 Share Posted February 14, 2014 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 ? Link to comment
Castillo Posted February 14, 2014 Share Posted February 14, 2014 Yes, it is. getPlayerAccount getAccountName setPlayerName To stop the player from changing his name use: cancelEvent with the event onPlayerChangeNick. Link to comment
MTA Team 0xCiBeR Posted February 14, 2014 MTA Team Share Posted February 14, 2014 Not Tested: addEventHandler ( 'onPlayerLogin', root, function ( _, theCurrentAccount ) local acc = getAccountName(theCurrentAccount) setPlayerName ( source, acc ) end ) function nickChangeHandler() cancelEvent() end addEventHandler("onPlayerChangeNick", root, nickChangeHandler) Link to comment
Karuzo Posted February 14, 2014 Author Share Posted February 14, 2014 Thank you Ciber, but got it How can i make a 'Remember Me' button ? Link to comment
MTA Team 0xCiBeR Posted February 14, 2014 MTA Team Share Posted February 14, 2014 XML functions maybe the best. Link to comment
Karuzo Posted February 14, 2014 Author Share Posted February 14, 2014 Hmm, but what about if i want it to make with Account functions and don't want it to put it in a XML ? Isn't there another way ? Link to comment
MTA Team 0xCiBeR Posted February 14, 2014 MTA Team Share Posted February 14, 2014 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. Link to comment
Karuzo Posted February 14, 2014 Author Share Posted February 14, 2014 Thank you, gonna try it out. Link to comment
MTA Team 0xCiBeR Posted February 14, 2014 MTA Team Share Posted February 14, 2014 You're Welcome. 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