[Ajuda] Chat da Classe
#1

Existem 10 classes, dai fiz um chat onde os players poderгo conversar se forem da mesma classe (й como se fosse um chat de cada profissгo), o problema й que se alguйm da classe X usar o chat e eu sendo da classe Y consigo ver o que a pessoa fala e atй mesmo conversar com ela, acredito que o erro esteja no loop

pawn Код:
CMD:s(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid))
        return Msg(playerid, YELLOW, "[x] Vocк precisa estar logado para usar esse comando!");
       
    format(arquivo, sizeof(arquivo), "Scores/%s.ini", PlayerName(playerid));
    if(strcmp(DOF2_GetString(arquivo, "Classe"), "Nenhuma", true) == 0)
    {
        SendClientMessage(playerid, COR_BRANCO, "{FF0000}[x] Vocк nгo tem uma classe!");
        return 1;
    }
    if(DOF2_FileExists(arquivo))
    {
        if(strcmp(DOF2_GetString(arquivo, "Classe"), "Nenhuma", false))
        {
            if(!strlen(params))
            {
                SendClientMessage(playerid, COR_BRANCO, "[ > ] Uso correto: /s [texto]");
                return 0;
            }
            else
            {
                for(new c = 0; c < MAX_PLAYERS; c++)
                {
                    if(IsPlayerConnected(c))
                    {
                        format(arquivo, sizeof(arquivo), "Scores/%s.ini", PlayerName(c));
                        if(strcmp(DOF2_GetString(arquivo, "Classe"), DOF2_GetString(arquivo, "Classe"), true) == 0)
                        {
                            format(gstringi, sizeof(gstringi), "( Chat Classe ) %s: %s", PlayerName(playerid), params);
                            SendClientMessage(c, GetPlayerColor(playerid), gstringi);
                        }
                    }
                }
            }
            return 1;
        }
    } else{
        SendClientMessage(playerid, COR_BRANCO, "{FF0000}[x] Vocк nгo tem nenhuma classe!");
        return 1;
    }
    return 1;
}
Reply


Messages In This Thread
Chat da Classe - by viniciussvl - 05.02.2017, 14:23
Re: Chat da Classe - by ThuuGLif3 - 05.02.2017, 14:28
Re: Chat da Classe - by viniciussvl - 05.02.2017, 14:37
Re: Chat da Classe - by Whoo - 05.02.2017, 14:47
Re: Chat da Classe - by viniciussvl - 05.02.2017, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)