GetClientAccount: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Visual improvement) |
||
Line 1: | Line 1: | ||
{{Server function}} | {{Server function}} | ||
{{ | {{DeprecatedWithAlt|getPlayerAccount|}} | ||
__NOTOC__ | __NOTOC__ | ||
This function returns the specified client's [[account]] object. | This function returns the specified client's [[account]] object. |
Revision as of 14:21, 25 June 2014
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 )