SA-MP Forums Archive
[Ajuda] Tag no OnPlayerText - 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] Tag no OnPlayerText (/showthread.php?tid=460220)



Tag no OnPlayerText - LordShadow - 27.08.2013

Pessoal, eu queria colocar uma TAG de [Admin] quando o player falar no chat do server. Sу que nгo sei que funзгo usa para fazer isso. quem souber ajuda ae favor.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    if(PlayerInfo[playerid][pAdmin] > 1)
    {
   
    }
    return 1;
}



Re: Tag no OnPlayerText - smiiir - 27.08.2013

pawn Код:
public OnPlayerText ( playerid, text[] ) {

    new string [ 128 ], Nome [ 21 ] ;
    GetPlayerName ( playerid, Nome, 21 ) ;
   
    if ( PlayerInfo [ playerid ] [ pAdmin ] >= 1 ) {
       
        format ( string, 128, "[ Admin ]: %s ID:%d: %s", Nome, playerid, text   ) ;
        SendClientMessage ( -1, string ) ;
    }
    else {
   
        format ( string, 128, "%s ID:%d: %s", Nome, playerid, text   ) ;
        SendClientMessageToAll ( -1, string ) ;
    }
    return 1;
}



Re: Tag no OnPlayerText - DanishHaq - 27.08.2013

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], sendername[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] > 1)
    {
          GetPlayerName(playerid, sendername, sizeof(sendername));
          format(string, sizeof(string), "[Admin] %s: %s", sendername, text);
          SendClientMessageToAll(0xFFFFFFFF, string);
          return 1;
    }
    else
    {
          GetPlayerName(playerid, sendername, sizeof(sendername));
          format(string, sizeof(string), "%s: %s", sendername, text);
          SendClientMessageToAll(0xFFFFFFFF, string);
          return 1;
    }
    return 0;
}
Edit: Muito lento .. mas o meu vai funcionar...


Re: Tag no OnPlayerText - PT - 27.08.2013

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], sendername[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] > 1)
    {
          GetPlayerName(playerid, sendername, sizeof(sendername));
          format(string, sizeof(string), "[Admin] %s: %s", sendername, text);
          SendClientMessageToAll(0xFFFFFFFF, string);
          return 1;
    }
    else
    {
          GetPlayerName(playerid, sendername, sizeof(sendername));
          format(string, sizeof(string), "%s: %s", sendername, text);
          SendClientMessageToAll(0xFFFFFFFF, string);
          return 1;
    }
    return 0;
}
Edit: Muito lento .. mas o meu vai funcionar...
para que obter 2x o nome do player?

e preferivel usar o jeito do iSmirnoff mudando apenas 1 pequena coisa

pawn Код:
public OnPlayerText ( playerid, text[] ) {

    new string [ 128 ], Nome [ MAX_PLAYER_NAME ] ;
    GetPlayerName ( playerid, Nome, MAX_PLAYER_NAME ) ;
   
    if ( PlayerInfo [ playerid ] [ pAdmin ] >= 1 ) {
       
        format ( string, 128, "[ Admin ]: %s ID:%d: %s", Nome, playerid, text   ) ;
        SendClientMessageToAll ( -1, string ) ;
        return 1;
    }
    else {
   
        format ( string, 128, "%s ID:%d: %s", Nome, playerid, text   ) ;
        SendClientMessageToAll ( -1, string ) ;
    }
    return 1;
}