[Ajuda]Problema Gang chat
#1

galera eu tenho um ganh chat mais quando da ! mensagem aparece o chat tdm pq?

pawn Код:
if(text[0] == '!')
    {
        new string[128];GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), "||GANG CHAT||%s:%s", string, text[1]);
        printf("%s", string);

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
as gangs ta tudo no gTeam
Reply
#2

Como assim ? nгo intendi
Reply
#3

quan eu digito la ! mensagem aparece no chat normal tbm mostra pra gang mais tbm pro chat normal
Reply
#4

Troca : MAX_PLAYERS por MAX_GANGS
Reply
#5

Garfield nгo tem muito noзгo a sua resposta..

pawn Код:
if(text[0] == '!')
    {
        new string[128];GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), "||GANG CHAT||%s:%s", string, text[1]);
        printf("%s", string);

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
if(text[0] == '!') return 0; //isso returnarб 0
й Provavel que isto nгo funcione poste toda sua OnPlayerText eu tenho certeza que poderei lhe ajudar...
Reply
#6

pawn Код:
public OnPlayerText(playerid, text[])
{
    UpperToLower(text);
new string[256];
    format(string,sizeof(string),"(id:%d): %s",playerid,text);
    SendPlayerMessageToAll(playerid,string);
   
if(text[0] == '!')
    {
        new string[128];    GetPlayerName(playerid, string, sizeof(string));
        format(string, sizeof(string), "[*Walkie Talkie] %s:  %s", string, text[1]);
        printf("%s", string);

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
        return 0;
    }
        return 0;
    }
Reply
#7

A Posiзгo do Cуdigo esta errada faзa assim:

pawn Код:
public OnPlayerText(playerid, text[])
{
UpperToLower(text);
if(text[0] == '!')
{
new string[128];    GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[*Walkie Talkie] %s:  %s", string, text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
new string[128];
format(string,sizeof(string),"(id:%d): %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
Coloca [RESOLVIDO] a agradece -q
Reply
#8

Valeu Drakon deu certinho akie
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)