CopyAccountData: Difference between revisions
Jump to navigation
Jump to search
(updated) |
mNo edit summary |
||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example | This example copies the account data from the 'guest' to a registered account when they login | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function copyDataOnLogin ( | function copyDataOnLogin ( previousAccount, currentAccount ) | ||
copyAccountData ( | copyAccountData ( currentAccount, previousAccount ) | ||
end | end | ||
addEventHandler ( "onClientLogin", getRootElement(), copyDataOnLogin ) | addEventHandler ( "onClientLogin", getRootElement(), copyDataOnLogin ) |
Revision as of 11:32, 16 July 2007
This function copies all of the data from one account to another.
Syntax
bool copyAccountData ( account theAccount, account fromAccount )
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 ( "onClientLogin", 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