GetClientAccount

From Multi Theft Auto: Wiki
Revision as of 21:21, 20 April 2011 by Arran Fortuna (talk | contribs)
Jump to navigation Jump to search

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.


Please use getPlayerAccount

This function returns the specified client's account object.

Syntax

account getClientAccount ( client theClient )

Required Arguments

  • theClient: The client element (player or admin) you want to get the account of.

Returns

Returns the client's account object, or false if the client passed to the function is invalid.

Example

This example sets a player's money and also stores the value is his account.

function setMoney ( thePlayer, key, amount )
	setPlayerMoney ( thePlayer, amount )
	account = getClientAccount ( thePlayer )
	if ( account ) then
		setAccountData ( account, "money", amount )
	end
end
addCommandHandler ( "setmoney", setMoney )

See Also

BEFORE VERSION 1.0 :