CopyAccountData: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server function}}
{{Server function}}
此函数用于将所有数据从一个帐户([[account]])复制到另一个帐户.
此函数用于将所有数据从一个帐户[[account]]复制到另一个帐户.


==Syntax==  
==语法==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool copyAccountData ( account theAccount, account fromAccount )
bool copyAccountData ( account theAccount, account fromAccount )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[account]]:copyDataTo||}}
{{OOP_ZH-CN||[[account]]:copyDataTo||}}


===Required Arguments===  
===Required Arguments===  

Revision as of 01:21, 4 February 2021

此函数用于将所有数据从一个帐户account复制到另一个帐户.

语法

bool copyAccountData ( account theAccount, account fromAccount )

OOP 语法 什么是OOP?

方法: 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