getAccountSerial | Multi Theft Auto: Wiki Skip to content

getAccountSerial

Client-side
Server-side
Shared

This function returns the last serial that logged onto the specified account.

OOP Syntax Help! I don't understand this!

  • Method: account:getSerial(...)
  • Variable: .serial

Syntax

string|false getAccountSerial ( account theAccount )
Required Arguments
  • theAccount: The account to get serial from.

Returns

  • string|false: account's serial.

Returns string containing the serial, the string is empty if the account was never used. Returns false if invalid arguments were specified.

Code Examples

server

This example adds command getaccserial that outputs the given account's serial in the chat box.

addCommandHandler("getaccserial", function (player, cmd, accountName)
if (accountName) then
local account = getAccount(accountName) -- get account from name
if (account) then
outputChatBox("Serial: " .. getAccountSerial(account), player) -- get serial
else
outputChatBox("Account not found", player)
end
end
end)