GetPlayerUserName
From Multi Theft Auto: Wiki
This function is deprecated. This means that its use is discouraged. | |
MTA Community accounts were dropped in favor of serials for identifying players. |
This function returns the community.mtasa.com (or mtabeta.com) account of the specified user.
Syntax
Click to collapse [-]
Serverstring getPlayerUserName ( player thePlayer )
Required Arguments
- thePlayer: The player whose MTA account username you want to retrieve.
Returns
A string value containing the MTA account username or false if no account exists for the player.
Click to collapse [-]
Clientstring getPlayerUserName ()
Returns
A string value containing local player's MTA account username or false if no account exists for the local player.
Example
Click to collapse [-]
Serverfunction outputMTAAccount ( sourcePlayer ) -- if the command was triggered by an ingame player if ( sourcePlayer ) then local mtaaccount = getPlayerUserName( sourcePlayer ) if ( mtaaccount ) then outputChatBox("Your community.mtasa.com account is " .. mtaaccount, sourcePlayer ) else outputChatBox("Can't find an account for you.", sourcePlayer ) end end end -- register outputMTAAccount as a handler for the mta-account command addCommandHandler ( "mtaaccount", outputMTAAccount )
See Also
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
FROM VERSION 1.5.7 r19626 ONWARDS
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
FROM VERSION 1.5.7 r19626 ONWARDS
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerMoney
- takePlayerScreenShot