CopyAccountData

From Multi Theft Auto: Wiki
Revision as of 01:20, 4 February 2021 by Qwe7769611 (talk | contribs)
Jump to navigation Jump to search

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

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