SA-MP Forums Archive
[Ajuda] Como muda o jeito q fica o nick e o id, no 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] Como muda o jeito q fica o nick e o id, no chat (/showthread.php?tid=456700)



Como muda o jeito q fica o nick e o id, no chat - Jonathan4i20 - 07.08.2013

Ola gente, queria uma ajuda aqui, como mudo o jeito q fica o nick com o id no chat. Ex: Jonathan: (0) eae pessoal
Entao, eu qeria q ficasse assim ex: • [ 0 ] Jonathan eae pessoal
Alguem poderia me ajudar?


Re: Como muda o jeito q fica o nick e o id, no chat - Mteck - 07.08.2013

https://sampwiki.blast.hk/wiki/OnPlayerText


Re: Como muda o jeito q fica o nick e o id, no chat - focaximubh - 07.08.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
        new string[128], nomej[MAX_PLAYER_NAME];
        GetPlayerName(playerid, nomej, sizeof(nomej));
        format(string, sizeof(string),"> %d <  %s: %s", playerid, nomej, text);
        SendClientMessageToAll(-1, string);
        return 0;
}



Re: Como muda o jeito q fica o nick e o id, no chat - Jonathan4i20 - 07.08.2013

Ai veio, eu coloquei mais deu erro, ai dai o meu tava assim antes de eu muda:

PHP код:
new aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
new 
string2[256];
format(string2256,"%s (%d): %s"anameplayerid,text);
MsgLog(string2);
format(filesizeof(file), PASTA_CONTASaname);
if(
strlen(text) > 60)

Depois eu mudei para :

PHP код:
new aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
new 
string2[256];
format(string2256,"• [ %d ] %s %s"playeridaname,text);
MsgLog(string2);
format(filesizeof(file), PASTA_CONTASaname);
if(
strlen(text) > 60)
{
SendClientMessage(playeridVermelho"[ x ] Texto grande demais!");
return 
0;
}
if(
Mute[playerid] == 1)
{
SendClientMessage(playeridVermelho"[ x ] Vocк estб mudo, e nгo pode falar.");
return 
0;

Mais ai aparece assim : Jonathan: (0) eae pessoal

me ajudem?


Re: Como muda o jeito q fica o nick e o id, no chat - Kuddy - 07.08.2013

Poste todo o OnPlayerText do seu GM.


Re: Como muda o jeito q fica o nick e o id, no chat - Jonathan4i20 - 07.08.2013

Aki meu OnPlayerText

PHP код:
public OnPlayerText(playeridtext[])
{
for(new 
i=0MAX_PLAYERSi++)
{
if(
IsPlayerConnected(i))
{
if(
chat[i] == && pAdmin[playerid] == 0)
{
SendClientMessage(playerid0xFF0000AA"[ x ]O Chat estб desativado!");
return 
0;
}
}
}
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playeridanameMAX_PLAYER_NAME);
new 
string2[256];
format(string2256,"• [ %d ] %s %s"playeridaname,text);
MsgLog(string2);
format(filesizeof(file), PASTA_CONTASaname);
if(
strlen(text) > 60)
{
SendClientMessage(playeridVermelho"[ x ] Texto grande demais!");
return 
0;
}
if(
Mute[playerid] == 1)
{
SendClientMessage(playeridVermelho"[ x ] Vocк estб mudo, e nгo pode falar.");
return 
0;

ATENЗГO: ELE ESTA DO JEITO QUE EU QUERIA ALI NO FORMAT, MAIS ELE SAI ASSIM : Jonathan: (0) eae pessoal
Me ajudem pf


Re: Como muda o jeito q fica o nick e o id, no chat - Jonathan4i20 - 08.08.2013

Alguem? pf ( Desculpe pelo double ) quero muito isso


Re: Como muda o jeito q fica o nick e o id, no chat - PT - 08.08.2013

acho que ficara assim

pawn Код:
public OnPlayerText(playerid, text[])
{
    new aname[MAX_PLAYER_NAME], string2[256];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
   
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(chat[i] == 1 && pAdmin[playerid] == 0)
            {
                SendClientMessage(playerid, 0xFF0000AA, "[ x ]O Chat estб desativado!");
                return 0;
            }
        }
    }
    if(strlen(text) > 60)
    {
        SendClientMessage(playerid, Vermelho, "[ x ] Texto grande demais!");
        return 0;
    }
    if(Mute[playerid] == 1)
    {
        SendClientMessage(playerid, Vermelho, "[ x ] Vocк estб mudo, e nгo pode falar.");
        return 0;
    }
    format(string2, sizeof(string),"• [ %d ] %s %s", playerid, aname, text);
    MsgLog(string2);
    SendClientMessageToAll(-1, string2);
    return 1;
}



Re: Como muda o jeito q fica o nick e o id, no chat - [THs]ShadoW - 08.08.2013

Quote:
Originally Posted by Jonathan4i20
Посмотреть сообщение
PHP код:
format(string2256,"• [ %d ] %s %s"playeridaname,text);
MsgLog(string2);
format(filesizeof(file), PASTA_CONTASaname); 
Como que vai funcionar se tu n enviou a mensagem pra ngm ? .-.

Desculpem-me se estou errado, mas acho que й isso.


Re: Como muda o jeito q fica o nick e o id, no chat - [A]rray - 08.08.2013

Quote:
Originally Posted by [THs]ShadoW
Посмотреть сообщение
Como que vai funcionar se tu n enviou a mensagem pra ngm ? .-.

Desculpem-me se estou errado, mas acho que й isso.
Й sim. Porйm, o cуdigo dele tambйm nгo estava muito bem organizado.