Mostrar ID en el chat y color de admin
#9

Listo, pude hacerlo:
Код:
public OnPlayerText(playerid, text[])
{
  new str[128], name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof(name));
  if(IsPlayerAdmin(playerid))
	{
    format(str, sizeof(str), "* %s [%d]: %s", name, playerid, text);
    SendClientMessageToAll(COLOR_CELESTE, str);
  }
  else
	{
	// FORMA 1: "Nombre [ID]: texto
 	new pname[MAX_PLAYER_NAME+5];
  new pname2[MAX_PLAYER_NAME+5];
  GetPlayerName(playerid,pname,sizeof(pname));
  format(pname2,sizeof(pname2),"%s[%d]",pname,playerid);
  SetPlayerName(playerid,pname2);
  SendPlayerMessageToAll(playerid,text);
  SetPlayerName(playerid,pname);
  // FORMA 2: "Nombre:[ID] texto
   //  format(str, sizeof(str), "[%d] %s", playerid, text);
   // SendPlayerMessageToAll(playerid, str);
  }
  return 0;
}
Gracias a los dos
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)