ZH-CN/setAccountPassword: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
bool removeAccount ( account theAccount )
bool removeAccount ( account theAccount )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[account]]:remove||}}
{{OOP_ZH-CN||[[account]]:remove||}}


===必填参数===  
===必填参数===  

Revision as of 08:25, 4 February 2021

此函数用于删除现有玩家帐户.

语法

bool removeAccount ( account theAccount )

OOP 语法 什么是OOP?

方法: account:remove(...)

必填参数

  • theAccount: 您要删除的帐户

Returns

如果成功删除帐户,则返回“true”;如果帐户不存在,则返回“false”

示例

This example does...

function onCmdDeregister ( playerSource, commandName )
	-- grab the account
	local sourceAccount = getPlayerAccount ( playerSource )
	if sourceAccount then
		removeAccount ( sourceAccount )
		outputChatBox ( "Account deregistered for " .. getPlayerName ( playerSource ) )
	else 
		outputChatBox ( "Unable to get your account, make sure you are logged in", playerSource )
	end
end
 
addCommandHandler("deregister",onCmdDeregister)

See Also