removeAccount | Multi Theft Auto: Wiki Skip to content

removeAccount

Client-side
Server-side
Shared

Pair: addAccount

This function is used to delete existing player accounts.

OOP Syntax Help! I don't understand this!

Syntax

bool removeAccount ( ​account theAccount )
Required arguments
  • theAccount: The account you wish to remove.

Returns

Returns true if account was successfully removed, false if the account does not exist.

  • bool: result

Code Examples

server

This example deletes the specified account when the deregister command is entered.

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