RemoveAccount: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
No edit summary |
||
Line 21: | Line 21: | ||
if playerName ~= nil then | if playerName ~= nil then | ||
-- Lets get the player from the nick provided | -- Lets get the player from the nick provided | ||
local targetPlayer = | local targetPlayer = getPlayerFromName ( playerName ) | ||
-- Checking if the player actually exists | -- Checking if the player actually exists | ||
if targetPlayer ~= nil then | if targetPlayer ~= nil then |
Revision as of 16:16, 22 November 2011
This function is used to delete existing player accounts.
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.
Example
This example does...
function onCmdRemove ( playerSource, commandName, playerName ) -- Lets make sure they didn't put nothing for the playername if playerName ~= nil then -- Lets get the player from the nick provided local targetPlayer = getPlayerFromName ( playerName ) -- Checking if the player actually exists if targetPlayer ~= nil then -- grab the accounts local sourceAccount = getPlayerAccount ( playerSource ) local targetAccount = getPlayerAccount ( targetPlayer ) -- Now check to see if the player has greater priviledges (or levels) if getAccountLevel ( sourceAccount ) > getAccountLevel ( targetAccount ) then removeAccount ( targetAccount ) outputChatBox ( getPlayerName ( playerSource ) .. " removed " .. playerName .. "'s account" ) else outputChatBox ( "You don't have authority to remove " .. playerName .. "'s account", playerSource ) end else outputChatBox ( "There is no player by the name of " .. playerName, playerSource ) end else outputChatBox ( "USAGE: /remove [playername]", playerSource ) end end addCommandHandler("remove",onCmdRemove)
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