monamour Posted March 25, 2018 Share Posted March 25, 2018 (edited) hello everyone, am trying to make script which change playernick to his accountname after he login ( making player having same nick as his account name if he log in) iv'e tried this but it did not worked: addEventHandler ( 'onPlayerLogin', getRootElement ( ), function (, changnick ) localgetPlayerAccount(theCurrentAccount) then setPlayerName ( sPlayerElement, thecurrentaccount ) i know there are many mistakes in this script but am just new and i hope to learn please help me to fix it Edited March 25, 2018 by monamour Link to comment
Moderators IIYAMA Posted March 25, 2018 Moderators Share Posted March 25, 2018 (edited) addEventHandler ( "onPlayerLogin", root, function (_, theCurrentAccount ) setPlayerName ( source, getAccountName(theCurrentAccount) ) end) https://wiki.multitheftauto.com/wiki/GetAccountName string getAccountName ( account theAccount ) https://wiki.multitheftauto.com/wiki/OnPlayerLogin Parameters thePreviousAccount: The account the player was logged into before theCurrentAccount: The account the player logged into just now Source The source of this event is the player element that just logged in. Edited March 25, 2018 by IIYAMA 1 Link to comment
monamour Posted March 25, 2018 Author Share Posted March 25, 2018 it didn't work!! still nick not changed to account name on login Link to comment
Moderators IIYAMA Posted March 25, 2018 Moderators Share Posted March 25, 2018 Show me the lua file and the meta.xml file. 1 Link to comment
monamour Posted March 25, 2018 Author Share Posted March 25, 2018 (edited) 12 minutes ago, IIYAMA said: Show me the lua file and the meta.xml file. meta.xml: <meta> <info name="changenick" author="Gamesnert" type="script" version="0.9.0" description="This resource change nick to account when player login"/> <script src="changenick_s.lua" type="server"/> </meta> Lua: addEventHandler ( "onPlayerLogin", root, function (_, theCurrentAccount ) setPlayerName ( source, getAccountName(theCurrentAccount) ) end) Edit : am sorry but it works now , ive forgot to upgrade the Resource Thank you very much to help me with this script , i really appreciate it i will upload it to community and give you credit for it if you dont mind Edited March 25, 2018 by monamour 1 Link to comment
Discord Moderators Pirulax Posted March 28, 2018 Discord Moderators Share Posted March 28, 2018 Use code tags (<>) please. Use /debugscript 3, please. Thanks. 1 Link to comment
pa3ck Posted March 28, 2018 Share Posted March 28, 2018 @Pirulax he just said he got it working.. on Sunday.. 1 Link to comment
monamour Posted March 29, 2018 Author Share Posted March 29, 2018 20 hours ago, Pirulax said: Use code tags (<>) please. Use /debugscript 3, please. Thanks. already sloved , but thank you anyway Link to comment
Discord Moderators Pirulax Posted March 29, 2018 Discord Moderators Share Posted March 29, 2018 19 hours ago, pa3ck said: @Pirulax he just said he got it working.. on Sunday.. I know, but i just gave him tips, if he asks for help in the future. 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