[Ajuda] Chat
#1

Eae galera agora todo o server esta vendo o chat das torcidas eu queria q so os menbros da t.o podesem ver o chat alguem me ajuda ae pf cуdigo :
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        if(PlayerInfo[playerid][pTorcida] == 1)
        {
        new Nome[24], String[128];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pTorcida] == 1)
            {
                SendHelperMessage(COLOR_TVP, String);
                return 0;
            }
        }
        }
        if(PlayerInfo[playerid][pTorcida] == 2)
        {
        new Nome[24], String[128];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pTorcida] == 2)
            {
                SendHelperMessage(COLOR_TVP, String);
                return 0;
                        }

            }
        }
    }
 }
    return 1;
}

public SendHelperMessage(color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pTorcida] == 1)
            {
                SendClientMessage(i, COLOR_TVP, string);
                    }
            if(PlayerInfo[i][pTorcida] == 2)
            {
                SendClientMessage(i, COLOR_TVP, string);
            }
        }
    }
    printf("[Chat]%s", string);
}// Esta tipow Chat Global
Reply
#2

antes estva funcionando normal ?
se sim nao sei
se nao e tipo um new da torcida ou define nao sei explicar perfeito aguarde os mais experientes ae!
Reply
#3

й em static Torcida[MAX_PLAYERS];
Reply
#4

Tenta ai
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        new Nome[24], String[128];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        if(PlayerInfo[playerid][pTorcida] == 1)
            format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
        else if(PlayerInfo[playerid][pTorcida] == 2)
            format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);

        SendHelperMessage(COLOR_TVP, String);
        return 0;
    }
    return 1;
}

public SendHelperMessage(color, string[])
{
    for(new i, j = GetMaxPlayers(); i != j; i++)
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pTorcida] == 1)
                SendClientMessage(i, COLOR_TVP, string);
            else if(PlayerInfo[i][pTorcida] == 2)
                SendClientMessage(i, COLOR_TVP, string);
        }

    printf("[Chat]%s", string);
}
Reply
#5

static local й destruнda ao termino de cada chave, uma new local й destruнda ao termino de cada funзгo ou ao termino da chave local.

Tenta mudar para new Torcida[MAX_PLAYERS];
Reply
#6

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Tenta ai
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        new Nome[24], String[128];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        if(PlayerInfo[playerid][pTorcida] == 1)
            format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
        else if(PlayerInfo[playerid][pTorcida] == 2)
            format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);

        SendHelperMessage(COLOR_TVP, String);
        return 0;
    }
    return 1;
}

public SendHelperMessage(color, string[])
{
    for(new i, j = GetMaxPlayers(); i != j; i++)
        if(IsPlayerConnected(i))
            SendClientMessage(i, COLOR_TVP, string);

    printf("[Chat]%s", string);
}
Sгo 72 TORCIDAS VEY kk postei so estas 2 mals vou testar leonardo
Reply
#7

Adicione o resto ...
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        new Nome[24], String[128];
        GetPlayerName(playerid, Nome, sizeof(Nome));
        if(PlayerInfo[playerid][pTorcida] == 1)
            format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : {FFFFFF}%s", Nome, text[1]);
        else if(PlayerInfo[playerid][pTorcida] == 2)
            format(String, sizeof(String), "[Chat Torcida Coringгo Chopp] %s : {FFFFFF}%s", Nome, text[1]);

        SendHelperMessage(playerid, COLOR_TVP, String);
        return 0;
    }
    return 1;
}

public SendHelperMessage(playerid, color, string[])
{
    for(new i, j = GetMaxPlayers(); i != j; i++)
        if(IsPlayerConnected(i))
            if(PlayerInfo[playerid][pTorcida] == PlayerInfo[i][pTorcida])
                SendClientMessage(i, COLOR_TVP, string);

    printf("[Chat]%s", string);
}
Reply
#8

Deu certo n vey
Reply
#9

Alguem me ajuda ae pff
Reply
#10

Como disse no outro post seu sobre isso
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        if(PlayerInfo[playerid][pTorcida] == 1)
        {
            new Nome[24], String[128];
            GetPlayerName(playerid, Nome, sizeof(Nome));
            format(String, sizeof(String), "[Chat Gaviхes da Fiel] %s : %s", Nome, text[1]);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(VarTorcida[i] == Torcida[playerid])
                {
                   SendClientMessage(i, COLOR_TVP, String);
                   return 0;
                }
            }
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)