CopyAccountData: Difference between revisions
Jump to navigation
Jump to search
Jurandovsky (talk | contribs) No edit summary |
m (Edited language change) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 19: | Line 19: | ||
This example copies the account data from the 'guest' to a registered account when they login | This example copies the account data from the 'guest' to a registered account when they login | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function copyDataOnLogin ( previousAccount, currentAccount | function copyDataOnLogin ( previousAccount, currentAccount ) | ||
copyAccountData ( currentAccount, previousAccount ) | copyAccountData ( currentAccount, previousAccount ) | ||
end | end | ||
Line 28: | Line 28: | ||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} | ||
[[ru:copyAccountData]] | [[ru:copyAccountData]] | ||
[[ar:copyAccountData]] | [[ar:copyAccountData]] | ||
[[pl:copyAccountData]] | [[pl:copyAccountData]] | ||
[[zh-cn:copyAccountData]] |
Latest revision as of 14:40, 8 June 2022
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!
- Method: account:copyDataTo(...)
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 ) 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