[Ajuda] INI >> Dini
#1

Olб, boa tarde!

Alguйm me ajuda a criar um comando assim ?!

pawn Код:
if(strcmp(cmd, "/ban", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
                return true;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1341)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! {E31919}(/jogar)");
                    return true;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(PlayerInfo[giveplayerid][pAdmin] >= 1340)
                        {
                            SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode banir um Admin Dono !");
                            return true;
                        }
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[100];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USE: /ban [id] [motivo]");
                            return true;
                        }
                        getdate(year, month, day);
                        if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
                        {
                            format(string, sizeof(string), "AdmCmd: %s foi banido pelo Sistema(Modo Cia), Motivo: %s (%d-%d-%d)", giveplayer,(result),day,month,year);
                            BanLog(string);
                            format(string, sizeof(string), "AdmCmd: %s foi banido pelo Sistema, Motivo: %s", giveplayer,(result));
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                        }
                        else
                        {
                            format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s (%d-%d-%d)", giveplayer, sendername, (result),day,month,year);
                            BanLog(string);
                            format(string, sizeof(string), "AdmCmd: %s foi banido por %s, Motivo: %s", giveplayer, sendername, (result));
                            SendClientMessageToAll(COLOR_LIGHTRED, string);
                        }
                        PlayAudioStreamForPlayer(giveplayerid,"http://dl.dropbox.com/u/75928881/Musicas/preview%20(1).mp3");
                        SendClientMessage(giveplayerid, COLOR_WHITE, "|________________[ Instruзхes para revisгo de Ban ]________________|");
                        SendClientMessage(giveplayerid, COLOR_YELLOW2, "Tire uma SS da tela apertando F8 imediatamente apуs ser banido");
                        SendClientMessage(giveplayerid, COLOR_YELLOW2, "E acesse o nosso forum: www.befrpg.forumeiros.com");
                        SendClientMessage(giveplayerid, COLOR_LIGHTRED, "Atenзгo: Vocк sу serб desbanido caso for inocente");
                        PlayerInfo[giveplayerid][pBan] = 1;
                        SBan(giveplayerid, result, PlayerName(playerid));
                        return true;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Esse nгo й um jogador ativo.");
            }
        }
        return true;
    }
Vlw!
Reply
#2

Tenta,faz tempo que nгo mexo com dini,mas creio que esteja certo.

pawn Код:
if(strcmp(cmd,"/infoban",true)==0)
    {
        new conta[60], Adm[21], MotivoBan[100], DataBan[25], HoraBan[22];
        if(PlayerInfo[playerid][pAdmin] < 1337)
            return SendClientMessage(playerid, COR_CINZA1, "Vocк nгo tem permissгo para usar esse comando!");
        if(sscanf(params, "s[21]", conta))
            return SendClientMessage(playerid, COR_CINZA2, "Use: /infoban [Nome_Conta] * use Maiusculas e Minusculas *]");
        format(String, 50, "Banidos/%s.ini", conta);
        if(fexist(String))
        {
            Adm[21] = Dini_Get(String, "Admin");
            MotivoBan[100] = Dini_Get(String, "Motivo");
            DataBan[25] = Dini_Get(String, "Data");
            HoraBan[22] = Dini_Get(String, "Hora");
            format(String, 60, "|| -- Informaзхes do Banimento do "VERMELHO"%s -- ||", conta);
            SendClientMessage(playerid, COR_AMARELO2, String);
            format(String, 40, "Admin que Baniu: "VERDE"%s ", Adm);
            SendClientMessage(playerid, COR_AMARELO, String);
            format(String, 128, "Motivo do Ban: "VERDE"%s ", MotivoBan);
            SendClientMessage(playerid, COR_AMARELO2, String);
            format(String, 40, "Data do Ban: "VERDE"%s ", DataBan);
            SendClientMessage(playerid, COR_AMARELO, String);
            format(String, 40, "Hora do Ban: "VERDE"%s ", HoraBan);
            SendClientMessage(playerid, COR_AMARELO2, String);
        }
        else
        {
            SendClientMessage(playerid, COR_CINZA3, "Essa conta nгo estб banida ou nгo existe!. ");
        }

        return 1;
    }
Reply
#3

@Edit mudei o tуpico.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)