synskidz Posted November 9, 2016 Posted November 9, 2016 -- i want to know about michael99's resource known "m-nickname". i really need help function setPlayerName (thePlayer) acc = getPlayerAccount(thePlayer) user = getAccountName(acc) if user then setPlayerName(thePlayer,user) end end addEventHandler("onPlayerLogin",getRootElement(),setPlayerName)
</Mr.Tn6eL> Posted November 9, 2016 Posted November 9, 2016 This code sets player name as his account name when logging in 1
synskidz Posted November 10, 2016 Author Posted November 10, 2016 12 hours ago, </Mr.Tn6eL> said: This code sets player name as his account name when logging in yeah but its not working, where's the mistake?
iPrestege Posted November 10, 2016 Posted November 10, 2016 (edited) 49 minutes ago, synskidz said: yeah but its not working, where's the mistake? Hi your mistake is that you are using thePlayer but the player in this event is the source. Edited November 10, 2016 by iPrestege
' A F . Posted November 10, 2016 Posted November 10, 2016 Try this addEventHandler ( "onPlayerLogin" , root , function ( _ , account ) setPlayerName ( source , getAccountName ( account ) ) end ); 1
Rat32 Posted November 10, 2016 Posted November 10, 2016 (edited) This not work because you using a setPlayerName function - function is created already by mta, change function name. Edited November 10, 2016 by Tasumi 1
synskidz Posted November 10, 2016 Author Posted November 10, 2016 14 hours ago, Default said: Try this addEventHandler ( "onPlayerLogin" , root , function ( _ , account ) setPlayerName ( source , getAccountName ( account ) ) end ); thanks dude... its work
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