[Ajuda] Por que o banimento nгo funciona?
#7

Hum, ok.

Vocк deve ter percebido que eu nгo sou muito bom em pwn, entгo no caso do dini_Int, eu teria que mudar para dini_Get ?

Seu fosse para eu colocar o booleana no meu sistema de banido ficaria mais pratico para min ?

Sobre o comando de banimento, eu tenho 3 tipos de banimento, por conta normal, quando o player se localiza online no servidor, banimento por um determinado tempo, e banimento por nick.

Sгo eles:
pawn Код:
if(strcmp(cmd,"/banirnick",true) == 0)
    {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirnick [nome-do-jogador] [motivo]");
                return 1;
            }
            for(new a=0; a < strlen(tmp); a++)
            {
                if((tmp[a] < 40 && tmp[a] != 36) || (tmp[a] > 41 && tmp[a] != 46 && tmp[a] < 48) || (tmp[a] > 57 && tmp[a] != 61 && tmp[a] < 64) ||
                (tmp[a] > 91 && tmp[a] < 93) || (tmp[a] > 95 && tmp[a] < 97) || tmp[a] > 122)
                {
                    SendClientMessage(playerid,COLOR_VERMELHO,"O nome que vocк deseja colocar possui carбcter(es) invбlido(s)!");
                    return 1;
                }
            }
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' ')) {
            idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
            result[idx - offset] = cmdtext[idx];
            idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result)) result = "Nгo usou motivo";
            if(strlen(result)>30)
            {
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!");
                return 1;
            }
            if(!dini_Isset(BanFile,tmp))
            {
                format(string, sizeof(string), "O %s %s(id:%d) baniu o nick %s por tempo ilimitado! Motivo: %s",
                admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,tmp,result);
                SendClientMessageToAll(COLOR_VERMELHO2,string);
                new year, month,day;
                getdate(year, month, day);
                new hora, minuto, segundo;
                gettime(hora,minuto,segundo);
                format(string, sizeof(string), "%s    |      \"%s\"      | %s    (%02d/%02d/%d) (%02d:%02d:%02d)",
                tmp,PlayerName(playerid), result, day ,month,year, hora,minuto,segundo);
                BanLog();
                BanNomeEspecial(PlayerName(playerid),tmp,result);
            }
            else SendClientMessage(playerid,COLOR_VERMELHO,"Este nick jб estб banido!");
        return 1;
    }
2°:
pawn Код:
if(strcmp(cmd,"/banir",true) == 0)
    {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banir [id-do-jogador] [motivo]");
                return 1;
            }
            giveplayerid = strval(tmp);
            if(playerid != giveplayerid)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(Stats[giveplayerid][VIP]==0)
                    {
                        if(!IsPlayerAdmin(giveplayerid) && Stats[giveplayerid][LEVELADMIN] < 2)
                        {
                            for(new i = 0; i < TOTALPLAYERS; i ++)
                            {
                                if(IsPlayerAdmin(i) || Stats[i][LEVELADMIN] > 0)
                                {
                                    if(i != playerid)
                                    {
                                        format(string, sizeof(string), "%s(id:%d) baniu %s(id:%d) permanente com o comando /banir.",
                                        PlayerName(playerid), playerid, PlayerName(giveplayerid), giveplayerid);
                                        SendClientMessage(i,COLOR_AZULFRACO,string);
                                    }
                                }
                            }
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' ')) {
                            idx++;
                            }
                            new offset = idx;
                            new result[64];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                            }
                            result[idx - offset] = EOS;
                            if(!strlen(result)) result = "Nгo usou motivo";
                            if(strlen(result)>30)
                            {
                                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!");
                                return 1;
                            }
                            new year, month,day;
                            getdate(year, month, day);
                            new hora, minuto, segundo;
                            gettime(hora,minuto,segundo);
                            format(string, sizeof(string), "%s  IP: %s    |      \"%s\"      | %s    (%02d/%02d/%d) (%02d:%02d:%02d)",
                            PlayerName(giveplayerid), PlayerIp(giveplayerid),PlayerName(playerid), result, day ,month,year, hora,minuto,segundo);
                            BanLog();
                            format(string, sizeof(string), "O %s %s(id:%d) baniu %s(id:%d) por tempo ilimitado! Motivo: %s",
                            admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,PlayerName(giveplayerid), giveplayerid,result);
                            SendClientMessageToAll(COLOR_VERMELHO2,string);
                            BanPlayerEspecial(PlayerName(playerid),giveplayerid,result);
                        }
                        else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um Administrador!");
                    }
                    else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um VIP!");
                }
                else SendClientMessage(playerid,COLOR_VERMELHO,"Este jogador nгo estб conectado!");
            }
            else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode usar este comando para si mesmo!");
        return 1;
    }
3°:
pawn Код:
if(strcmp(cmd,"/banirt",true) == 0)
    {
            tmp = strtok(cmdtext, idx);
            new tmpp[256];
            new tban = strval(tmpp);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirt [id-do-jogador] [tempo] [motivo]");
                return 1;
            }
            giveplayerid = strval(tmp);
            tmpp = strtok(cmdtext, idx);
            if(!strlen(tmpp))
            {
                SendClientMessage(playerid, COLOR_LARANJA2, "Digite: /banirt [id-do-jogador] [tempo] [motivo]");
                return 1;
            }
            tban = strval(tmpp);
            if(tban > 48 || tban < 1)
            {
                SendClientMessage(playerid,COLOR_VERMELHO,"Tempo invбlido! O tempo pode variar de 1 а 48 horas!");
                return 1;
            }
            if(playerid != giveplayerid)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(Stats[giveplayerid][VIP]==0)
                    {
                        if(!IsPlayerAdmin(giveplayerid) && Stats[giveplayerid][LEVELADMIN]<TEMPORARIO)
                        {
                            for(new i = 0; i < TOTALPLAYERS; i ++)
                            {
                                if(IsPlayerAdmin(i) || Stats[i][LEVELADMIN] > 0)
                                {
                                    if(i != playerid)
                                    {
                                        format(string, sizeof(string), "%s(id:%d) baniu %s(id:%d) com o comando /banirt.",
                                        PlayerName(playerid), playerid, PlayerName(giveplayerid), giveplayerid);
                                        SendClientMessage(i,COLOR_AZULFRACO,string);
                                    }
                                }
                            }
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' ')) {
                            idx++;
                            }
                            new offset = idx;
                            new result[64];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                            }
                            result[idx - offset] = EOS;
                            if(!strlen(result)) result = "Nгo usou motivo";
                            if(strlen(result)>30)
                            {
                                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк sу pode usar 30 carбcteres para o motivo!");
                                return 1;
                            }
                            new year, month,day;
                            getdate(year, month, day);
                            new hora, minuto, segundo;
                            gettime(hora,minuto,segundo);
                            format(string, sizeof(string), "%s(id:%d) foi banido pelo %s %s(id:%d) durante %d horas! Motivo de: %s.",
                            PlayerName(giveplayerid), giveplayerid, admincargo[Stats[playerid][LEVELADMIN]],PlayerName(playerid),playerid,tban,result);
                            SendClientMessageToAll(COLOR_VERMELHO2, string);
                            format(string, sizeof(string), "%s  IP: %s    |      \"%s\"      | %s    (%02d/%02d/%d) (%02d:%02d:%02d)",
                            PlayerName(giveplayerid), PlayerIp(giveplayerid),PlayerName(playerid), result, day ,month,year, hora,minuto,segundo);
                            BanLog();
                            BanPlayerEspecial(PlayerName(playerid),giveplayerid,result,tban);
                        }
                        else
                        {
                            SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um Admin!");
                            SendClientMessage(playerid,COLOR_VERMELHO,"Como essa tentativa nгo й permitida pelo servidor, vocк foi kickado de forma justa!");
                            format(string, sizeof(string),"%s(id:%d) tentou BANIR-LHE e foi automaticamente combatido pelo servidor sendo kickado!",PlayerName(playerid),playerid);
                            SendClientMessage(giveplayerid,COLOR_LARANJA2,string);
                            Kick(playerid);
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode banir um VIP!");
                        SendClientMessage(playerid,COLOR_VERMELHO,"Como essa tentativa nгo й permitida pelo servidor, vocк foi kickado de forma justa!");
                        format(string, sizeof(string),"%s(id:%d) tentou BANIR-LHE e foi automaticamente combatido pelo servidor sendo kickado!",PlayerName(playerid),playerid);
                        SendClientMessage(giveplayerid,COLOR_LARANJA2,string);
                        Kick(playerid);
                    }
                }
                else SendClientMessage(playerid, COLOR_VERMELHO,"Este jogador nгo estб conectado!");
            }
            else SendClientMessage(playerid,COLOR_VERMELHO,"Vocк nгo pode usar este comando para si mesmo!");
        return 1;
    }
Reply


Messages In This Thread
Por que o banimento nгo funciona? - by JoNhKaKa - 02.11.2014, 14:58
Re: Por que o banimento nгo funciona? - by [BOPE]Seu._.Madruga - 02.11.2014, 15:12
Respuesta: Por que o banimento nгo funciona? - by JoNhKaKa - 02.11.2014, 17:06
Re: Por que o banimento nгo funciona? - by Detoria - 02.11.2014, 20:23
Respuesta: Por que o banimento nгo funciona? - by JoNhKaKa - 02.11.2014, 20:47
Re: Por que o banimento nгo funciona? - by Detoria - 02.11.2014, 21:31
Respuesta: Por que o banimento nгo funciona? - by JoNhKaKa - 03.11.2014, 21:53
Re: Por que o banimento nгo funciona? - by Detoria - 04.11.2014, 00:10
Re: Por que o banimento nгo funciona? - by DannielCooper - 04.11.2014, 11:31
Respuesta: Por que o banimento nгo funciona? - by JoNhKaKa - 04.11.2014, 11:37

Forum Jump:


Users browsing this thread: 2 Guest(s)