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

  • bool: result

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

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)