SA-MP Forums Archive
[Ajuda]Problema Gang chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]Problema Gang chat (/showthread.php?tid=163581)



[Ajuda]Problema Gang chat[RESOLVIDO]>Drakon - Link_ - 28.07.2010

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


Re: [Ajuda]Problema Gang chat - [BR]JD - 28.07.2010

Como assim ? nгo intendi


Re: [Ajuda]Problema Gang chat - Link_ - 28.07.2010

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


Re: [Ajuda]Problema Gang chat - zSuYaNw - 28.07.2010

Troca : MAX_PLAYERS por MAX_GANGS


Re: [Ajuda]Problema Gang chat - ipsBruno - 28.07.2010

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...


Re: [Ajuda]Problema Gang chat - Link_ - 30.07.2010

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;
    }



Re: [Ajuda]Problema Gang chat - ipsBruno - 30.07.2010

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


Re: [Ajuda]Problema Gang chat[RESOLVIDO]By Drakon - Link_ - 31.07.2010

Valeu Drakon deu certinho akie