CopyAccountData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→Syntax: OOP) |
||
Line 7: | Line 7: | ||
bool copyAccountData ( account theAccount, account fromAccount ) | bool copyAccountData ( account theAccount, account fromAccount ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP|This function is also a static function underneath the Account class. This method transfers the data from sourceAccount to targetAccount.|[[account]]:copyDataTo||}} | |||
{{OOP|This is vice-versa; transfers data from targetAccount to sourceAccount.|[[account]]:copyDataFrom||}} | |||
Revision as of 15:56, 22 August 2014
This function copies all of the data from one account to another.
Syntax
bool copyAccountData ( account theAccount, account fromAccount )
OOP Syntax Help! I don't understand this!
- Note: This function is also a static function underneath the Account class. This method transfers the data from sourceAccount to targetAccount.
- Method: account:copyDataTo(...)
OOP Syntax Help! I don't understand this!
- Note: This is vice-versa; transfers data from targetAccount to sourceAccount.
- Method: account:copyDataFrom(...)
Required Arguments
- theAccount: The account you wish to copy the data to.
- fromAccount: The account you wish to copy the data from.
Returns
Returns a true if the accounts were valid, false otherwise.
Example
This example copies the account data from the 'guest' to a registered account when they login
function copyDataOnLogin ( previousAccount, currentAccount, autoLogin) copyAccountData ( currentAccount, previousAccount ) end addEventHandler ( "onPlayerLogin", getRootElement(), copyDataOnLogin )
See Also
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName