opnaiC Posted June 2, 2016 Share Posted June 2, 2016 How I can set the players name to his accounts name ? Tried something but it doesnt work ;( function accLoginName (source) name = getAccountName(source) setPlayerName (source, name) end addEventHandler("onResourceStart",getRootElement(),accLoginName ) Link to comment
Abdul KariM Posted June 2, 2016 Share Posted June 2, 2016 function accLoginName ( ) for i , players_ in ipairs ( getElementsByType ( "player" ) ) do local Acc = getPlayerAccount ( players_ ) if not ( isGuestAccount ( Acc ) ) then local Name = getAccountName ( Acc ) setPlayerName ( players_, Name ) end end end addEventHandler ( "onResourceStart",getRootElement(), accLoginName ) function accLoginName_ ( ) local Acc = getPlayerAccount ( source ) if Acc then local Name = getAccountName ( Acc ) setPlayerName ( source, Name ) end end addEventHandler ( "onPlayerLogin",getRootElement(), accLoginName_ ) 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