SA-MP Forums Archive
[Ajuda]Chat Global - 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]Chat Global (/showthread.php?tid=324838)



[Ajuda]Chat Global - joaonaveia - 11.03.2012

Meu server estб com chat global quero que esteja apenas para quem estб perto.


Re: [Ajuda]Chat Global - Lucas_Alemao - 11.03.2012

no meu GM eu uso assim, nunca testei com outros jogadores mas acredito que funcione
pawn Код:
public OnPlayerText(playerid, text[])
{
    format(String, sizeof(String), "%s Diz: %s", Nome(playerid), text);
    MensagemPerto(playerid, String, 20.0, CINZA1, CINZA2, CINZA3, CINZA4, CINZA5);
    return 0;
}
fim do gm
pawn Код:
stock MensagemPerto(playerid, mensagem[], Float:raio, cor1, cor2, cor3, cor4, cor5)
{
    new Float:X,
        Float:Y,
        Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    foreach(Player, i)
    {
        if(IsPlayerInRangeOfPoint(i, raio/16, X, Y, Z))
        {
            SendClientMessage(i, cor1, mensagem);
        }
        else if(IsPlayerInRangeOfPoint(i, raio/8, X, Y, Z))
        {
            SendClientMessage(i, cor2, mensagem);
        }
        else if(IsPlayerInRangeOfPoint(i, raio/4, X, Y, Z))
        {
            SendClientMessage(i, cor3, mensagem);
        }
        else if(IsPlayerInRangeOfPoint(i, raio/2, X, Y, Z))
        {
            SendClientMessage(i, cor4, mensagem);
        }
        else if(IsPlayerInRangeOfPoint(i, raio, X, Y, Z))
        {
            SendClientMessage(i, cor5, mensagem);
        }
    }
    return 1;
}



Re: [Ajuda]Chat Global - joaonaveia - 11.03.2012

Deu vбrios erros =D


Re: [Ajuda]Chat Global - humildadeforever - 11.03.2012

Vк se te ajuda: https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius


Re: [Ajuda]Chat Global - steki. - 11.03.2012

Ao inves do foreach no codigo do nosso amigo, use
for(new i; i < MAX_PLAYERS; i++)


Re: [Ajuda]Chat Global - joaonaveia - 11.03.2012

Conseguii valeu ae.


Re: [Ajuda]Chat Global - Lucas_Alemao - 11.03.2012

claro q vc tem a adaptar para seu game mode oO

pawn Код:
//topo
#define CINZA1                  0xE6E6E6E6
#define CINZA2                  0xC8C8C8C8
#define CINZA3                  0xAAAAAAAA
#define CINZA4                  0x8C8C8C8C
#define CINZA5                  0x6E6E6E6E

//fim
stock Nome(playerid)
{
    new pnome[24];
    GetPlayerName(playerid, pnome, 24);
    return pnome;
}
e ao invйs de foreach use um loop comum, como o Stewie disse