Jump to content

[HELP] BAN


MaRcell

Recommended Posts

 

well, I did this system of banning player by command, but it is not going, I write / iban ID, days and nothing happens .. will there be a problem with the account I made

 

addCommandHandler("iban",
function(playerSource, commandName, id, days, ...)

if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup ("Admin")) then
    if(id) then
        local playerID = tonumber(id)
        seconds = tonumber(seconds) or 60 
        if(playerID) then
                local targetPlayer = getPlayerID(playerID)
                if targetPlayer then
        		local seconds = days*86400
                local reason = table.concat({...}, " ")
                if ( hasObjectPermissionTo (playerSource, "function.banPlayer" ) ) then
                	outputChatBox("#00FFFFO jogador "..getPlayerName(targetPlayer).." foi banido por ".. tostring(seconds).." dias por "..getPlayerName(playerSource)..". Motivo: "..reason..".",root,0,0,0,true)

                    banPlayer(targetPlayer , false, false, true, getRootElement(), reason, seconds)
     end
        end

    end
end
end
end)


 

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...