Jump to content
  • 0

Where the /register go ?


blacknedvertigo

Question

5 answers to this question

Recommended Posts

  • 0

Yeah this is what I've asked before but never got a clear answer.

I got this from wiki https://wiki.multitheftauto.com/wiki/RemoveAccount:

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 = getPlayerFromNick ( 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 

To check what accounts exist, use this https://wiki.multitheftauto.com/wiki/GetAccounts:

function printAmountOfAccounts ( thePlayer ) 
    local accountTable = getAccounts () -- return the table over accounts 
    if #accountTable == 0 then -- if the table is empty 
        outputChatBox( "There are no accounts. \"{SMILIES_PATH}/icon_sad.gif\" alt=\"\" title=\"Sad\" />", thePlayer ) 
    else -- table isn't empty 
        outputChatBox( "There are " .. #accountTable .. " accounts in this server!", thePlayer ) 
    end 
end 
addCommandHandler( "accountcount", printAmountOfAccounts ) -- add a command handler for command 'accountcount' 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...