Ir para baixo
Danshweger
Danshweger
MEMBRO

MEMBRO
Mensagens : 156
Data de inscrição : 17/07/2016
Idade : 27
Localização : 127.0.0.1
http://www.transforxd.top/

Importante Comando de não banir determinados Administradores

Qua Abr 26, 2017 8:49 am
Olá pessoal.
Em pedido ao usuário Mateus da AM, vim trazer esse simples código para evitar que você seja banido do seu próprio server caso algum membro da equipe lhe traia.

Tutorial indicado para iniciantes que estão começando com o servidor agora e coloca 5000 mods para divulgar.

Vá nos seu comando de "ban" e procura por algo parecido com:

Código:
if this.server.banPlayer(playerName, hours, reason, this.client.playerName, silent):

Altere para este código:

Código:
if playerName in ["Danshweger", "Charmape"]:
    this.server.sendStaffMessage(5, "%s tentou banir um Administrador." %(this.client.Username))
    this.server.banPlayer(this.client.Username, 360, "Tentar banir um Administrador.", "Servidor", False)
else:
     if this.server.banPlayer(playerName, hours, reason, this.client.playerName, silent):


Devendo ficar dessa forma, por exemplo:
PRINT: http://prntscr.com/f10kxn

O membro da equipe que tentar banir os nomes determinados em [""], [""] serão banidos por 360h.
Algumas sources são diferentes, quem precisar de ajuda basta comentar abaixo que eu darei suporte.  What a Face


Última edição por Danshweger em Qua Abr 26, 2017 2:54 pm, editado 1 vez(es)
Nikopark
Nikopark
ADMINISTRADOR

ADMINISTRADOR
Mensagens : 1126
Data de inscrição : 25/12/2014
Idade : 26
Localização : Ontário, Canadá
https://www.aulamice.io/

Importante Re: Comando de não banir determinados Administradores

Qua Abr 26, 2017 2:49 pm
GG nice!
Becker
Becker
MEMBRO

MEMBRO
Mensagens : 261
Data de inscrição : 01/04/2015
Idade : 21
http://www.miceup.top

Importante Re: Comando de não banir determinados Administradores

Qua Abr 26, 2017 10:10 pm
Finalmente "estamos" tomando uma iniciativa para tentar reviver essa área.  cheers
Hopper
Hopper
MEMBRO

MEMBRO
Mensagens : 43
Data de inscrição : 24/03/2015
Idade : 23
Localização : Bahia
http://mademice.us

Importante Re: Comando de não banir determinados Administradores

Qui Abr 27, 2017 2:24 pm
Isso é algo que todos devem ter em sua source kkkk, é sempre melhor prevenir do que remediar.
WagnerMG
WagnerMG
MODERADOR

MODERADOR
Mensagens : 170
Data de inscrição : 01/10/2016

Importante Re: Comando de não banir determinados Administradores

Qua maio 31, 2017 1:04 am
Nixon escreveu:elif command == "ban" or command == "iban":
               if this.client.privLevel >= 5:
                   playerName = this.client.TFMUtils.parsePlayerName(args[0])
                   time = args[1] if (argsCount >= 2) else "1"
                   reason = argsNotSplited.split(" ", 3)[2] if (argsCount >= 3) else ""
                   silent = command == "iban"
                   hours = int(time) if (time.isdigit()) else 1
                   hours = 100000 if (hours > 100000) else hours
                   hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
                   if this.server.banPlayer(playerName, hours, reason, this.client.Username, silent):
                           this.server.sendModMessage(5, "<V>"+this.client.Username+"<BL> baniu <V>"+playerName+"<BL> por <V>"+str(hours)+"<BL> horas. Motivo: <V>"+str(reason)+"<BL>." )
                           aq=open("./comandos/ban.log","a"); aq.write(""+this.client.Username+" Baniu a "+playerName+" por "+str(hours)+" horas. Motivo: "+str(reason)+"\n")



HELP ?
Código:
           elif command == "ban" or command == "iban":
                if this.client.privLevel >= 6:
                    playerName = this.client.TFMUtils.parsePlayerName(args[0])
                    if playerName in ["Wagnermg"]:
                        this.server.sendModMessage(5, "%s tentou banir um Administrador" %(this.client.Username))
                        this.server.banPlayer(this.client.Username, 960, "Tentar banir um Administrador.", "Servidor", False)            
                    else:
                        playerName = this.client.TFMUtils.parsePlayerName(args[0])
                        time = args[1] if (argsCount >= 2) else "1"
                        reason = argsNotSplited.split(" ", 3)[2] if (argsCount >= 3) else ""
                        silent = command == "iban"
                        hours = int(time) if (time.isdigit()) else 1
                        hours = 10000000 if (hours > 10000000) else hours
                        hours = 10 if (this.client.privLevel <= 10 and hours > 10) else hours
                        if this.server.banPlayer(playerName, hours, reason, this.client.Username, silent):
                            this.server.sendModMessage(5, "<V>"+this.client.Username+"<BL> baniu <V>"+playerName+"<BL> por <V>"+str(hours)+"<BL> horas. Motivo: <V>"+str(reason)+"<BL>." )
                else:
                    playerName = this.client.TFMUtils.parsePlayerName(args[0])
                    this.server.voteBanPopulaire(playerName, this.client.ipAddress)
Galaktino
Galaktino
MEMBRO

MEMBRO
Mensagens : 94
Data de inscrição : 10/03/2016

Importante Re: Comando de não banir determinados Administradores

Qui Jun 15, 2017 12:04 pm
Boum ---' bem utilitario bom mermo hein  Cool
Conteúdo patrocinado

Importante Re: Comando de não banir determinados Administradores

Ir para o topo
Permissões neste sub-fórum
Não podes responder a tópicos