GetAccountType: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Added section to example) |
||
(One intermediate revision by the same user not shown) | |||
Line 13: | Line 13: | ||
===Returns=== | ===Returns=== | ||
Returns ''[[string]]'' containing the type of the account if the account is valid. | Returns ''[[string]]'' containing the type of the account if the account is valid. | ||
==Example== | ==Example== | ||
This example adds command ''accountInfo'' that outputs provided account info | This example adds command ''accountInfo'' that outputs provided account info | ||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addCommandHandler("accountInfo", function(player, cmd, accountName) | addCommandHandler("accountInfo", function(player, cmd, accountName) | ||
Line 37: | Line 33: | ||
end) | end) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Account_functions}} | {{Account_functions}} |
Latest revision as of 08:14, 11 June 2024
Syntax
string getAccountType ( account theAccount )
OOP Syntax Help! I don't understand this!
- Note: This function is a static function underneath the Account class.
- Method: Account.getType(...)
Required Arguments
- theAccount: An account you want to get info from
Returns
Returns string containing the type of the account if the account is valid.
Example
This example adds command accountInfo that outputs provided account info
Click to collapse [-]
ServeraddCommandHandler("accountInfo", function(player, cmd, accountName) if not accountName then outputChatBox("You have to provide an account's name to get info from!", player) return end local acc = getAccount(accountName) if not acc then outputChatBox("That account doesn't exist!", player) return end local accName = getAccountName(acc) local accType = getAccountType(acc) outputChatBox('Account name: '..accName..', type: '..accType, player) end)
See Also
- addAccount
- copyAccountData
- getAccount
- getAccountData
- getAccountName
- getAccountPlayer
- getAccountSerial
- getAccounts
- getAccountsBySerial
- getAllAccountData
- getPlayerAccount
- isGuestAccount
- logIn
- logOut
- removeAccount
- setAccountData
- setAccountPassword
- getAccountByID
- getAccountID
- getAccountIP
- getAccountsByData
- getAccountsByIP
- setAccountName