GetPlayerAccount

From Multi Theft Auto: Wiki
Revision as of 11:34, 5 January 2008 by Mountnl (talk | contribs) (New page: __NOTOC__ {{Server function}} Returns the accountname of the player ==Syntax== <syntaxhighlight lang="lua">int getPlayerAccount ( player thePlayer )</syntaxhighlight> ===Required Arguments=== *'''thePlayer:''...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Returns the accountname of the player

Syntax

int getPlayerAccount ( player thePlayer )

Required Arguments

  • thePlayer: The player you wish the retrieve the name of the account from.

Returns

Returns an string with name of the account. -- TODO -- What does it return if it isnt known?

Example

When a player types '/account' this example retrieves the player's accountname, and prints it to his screen.

function viewAccount(thePlayer, command)
	-- get the name of the account from thePlayer
	local accountName = getPlayerMoney(thePlayer) 
	
	-- output the message
	outputChatBox("Your account name is " .. accountName, thePlayer)  	
end

-- add the console command
addCommandHandler("account", viewAccount)                                    

See Also