[ajuda] /d bugado me ajudem
#1

o /d esta bugado meu gm й o GF pesso ajudar para desbugar*
pawn Код:
//----------------------------------[departments]-----------------------------------------------
    if(strcmp(cmd, "/departamento", true) == 0 || strcmp(cmd, "/d", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: (/d)epartamento [departamento chat]");
                return 1;
            }
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
            {
                if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Comandante %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Capitгo %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Tenente %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sargentot %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadete %s: %s, over. **", sendername, result); }
                else
                {
                    format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result);
                }
                SendTeamMessage(2, COLOR_ALLDEPT, string);
                SendTeamMessage(1, COLOR_ALLDEPT, string);
                printf("%s", string);
                return 1;
            }
            else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
            {
                if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Comandante de Elite %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Membro de Elite %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Agente Especial %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Agente Oficial %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Agente %s: %s, over. **", sendername, result); }
                else
                {
                    format(string, sizeof(string), "** Recruta %s: %s, over. **", sendername, result);
                }
                SendTeamMessage(2, COLOR_ALLDEPT, string);
                SendTeamMessage(1, COLOR_ALLDEPT, string);
                printf("%s", string);
                return 1;
            }
            else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
            {
                if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Tenete %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captiгo %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sargento %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Soldado %s: %s, over. **", sendername, result); }
                else
                {
                    format(string, sizeof(string), "** Soldado %s: %s, over. **", sendername, result);
                }
                SendTeamMessage(2, COLOR_ALLDEPT, string);
                SendTeamMessage(1, COLOR_ALLDEPT, string);
                printf("%s", string);
                return 1;
            }
            else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
            {
                format(string, sizeof(string), "** Medicos %s: %s, over. **", sendername, result);
                SendTeamMessage(2, COLOR_ALLDEPT, string);
                SendTeamMessage(1, COLOR_ALLDEPT, string);
                printf("%s", string);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Vocк nгo faz parte do time !");
                return 1;
            }
        }
        return 1;
    }
Reply
#2

Como bugado? esclareзa o bug.
Reply
#3

SendTeamMessage(4, COLOR_ALLDEPT, string);
SendTeamMessage(3, COLOR_ALLDEPT, string);
SendTeamMessage(2, COLOR_ALLDEPT, string);
SendTeamMessage(1, COLOR_ALLDEPT, string);
Reply
#4

eu coloco /d e digito o testo ai nao aparece nada, parece que o comando nao existe me ajudem**
Reply
#5

Pega do GF original o comando e altera para o seu GM, eu faзo assim quando da erro no meu
Reply
#6

Tenta Por No OnPlayerCommandText
Se Nao For o caso Nao sei :S
Reply
#7

to precisando de alguem com a soluзгo, e esse Gf ja й o original*
Reply
#8

Arrumei pra vocк, isto deve resolver o seu problema :

pawn Код:
if(strcmp(cmd, "/departamento", true) == 0 || strcmp(cmd, "/d", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new time = PlayerInfo[playerid][pMember];
            new time2 = PlayerInfo[playerid][pLeader];
            new result[256];
            result = strtok(cmdtext, idx);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: (/d)epartamento [departamento chat]");
                return 1;
            }
            if(time==1||time2==1||time== 2||time2== 2||time==3||time2==3||time==4||time2==4)
            {
                if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                {
                    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Comandante %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Capitгo %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Tenente %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sargentot %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadete %s: %s, over. **", sendername, result); }
                    else
                    {
                        format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result);
                    }
                    SendTeamMessage(1, COLOR_ALLDEPT, string);
                    SendTeamMessage(2, COLOR_ALLDEPT, string);
                    SendTeamMessage(3, COLOR_ALLDEPT, string);
                    SendTeamMessage(4, COLOR_ALLDEPT, string);
                    printf("%s", string);
                    return 1;
                }
                else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
                {
                    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Comandante de Elite %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Membro de Elite %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Oficial %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Agente Especial %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Agente Oficial %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Agente %s: %s, over. **", sendername, result); }
                    else
                    {
                        format(string, sizeof(string), "** Recruta %s: %s, over. **", sendername, result);
                    }
                    SendTeamMessage(1, COLOR_ALLDEPT, string);
                    SendTeamMessage(2, COLOR_ALLDEPT, string);
                    SendTeamMessage(3, COLOR_ALLDEPT, string);
                    SendTeamMessage(4, COLOR_ALLDEPT, string);
                    printf("%s", string);
                    return 1;
                }
                else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                {
                    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Tenete %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captiгo %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sargento %s: %s, over. **", sendername, result); }
                    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Soldado %s: %s, over. **", sendername, result); }
                    else
                    {
                        format(string, sizeof(string), "** Soldado %s: %s, over. **", sendername, result);
                    }
                    SendTeamMessage(1, COLOR_ALLDEPT, string);
                    SendTeamMessage(2, COLOR_ALLDEPT, string);
                    SendTeamMessage(3, COLOR_ALLDEPT, string);
                    SendTeamMessage(4, COLOR_ALLDEPT, string);
                    printf("%s", string);
                    return 1;
                }
                else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
                {
                    format(string, sizeof(string), "** Medicos %s: %s, over. **", sendername, result);
                    SendTeamMessage(1, COLOR_ALLDEPT, string);
                    SendTeamMessage(2, COLOR_ALLDEPT, string);
                    SendTeamMessage(3, COLOR_ALLDEPT, string);
                    SendTeamMessage(4, COLOR_ALLDEPT, string);
                    printf("%s", string);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Vocк nгo faz parte do time !");
                return 1;
            }
        }
        return 1;
    }

Espero ter ajudado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)