getAccountByID
Client-side
Server-side
Shared
This function returns the account with the specific ID.
Syntax
account|false getAccountByID ( int id )
Required Arguments
- id: The ID to get account from.
Returns
- account|false: account
Returns account associated with specified ID. Returns false if invalid arguments were specified or there is no account with this ID..
Code Examples
server
This example adds command getAccount that outputs the account-name of the account with ID.
addCommandHandler("getAccount", function (player, cmd, id) local id = tonumber(id) local account = getAccountByID(id) if (account) then outputChatBox("The name of the account with that ID is: "..getAccountName(account), player) else outputChatBox("There is no account with this ID.", player) endend)
See Also
Account Functions
- addAccount
- copyAccountData
- getAccountByID
- getAccount
- getAccountData
- getAccountID
- getAccountIP
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccountType
- getAccounts
- getAccountsByData
- getAccountsByIP
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- removeAccount
- logOut
- setAccountData
- setAccountName
- setAccountPassword
- setAccountSerial