#1

i have make this code to got the player name and ip and its work fine but i want add a color to the name and ip how?

Код:
CMD:ip(playerid,params[])
{
  new targetid;
  if(!IsPlayerAdmin(playerid)) return SCM(playerid, RED, "UnKnown Command! Type /help");
  if(sscanf(params,"u", targetid)) return SCM(playerid, RED, "Getting ip of a player: /ip <playerid>");
  if(!IsPlayerConnected(targetid)) return SCM(playerid, RED, "Player is not connected");
  

  new ip[25], ip_msg[100], ip_name[MAX_PLAYER_NAME], str[24];
  GetPlayerName(playerid, ip_name,sizeof (ip_name));
  GetPlayerIp(playerid, ip,sizeof (ip));
  format(ip_msg,sizeof (ip_msg),"(%s)",ip);
  format(str,sizeof (str),"%s", ip_name);

  ShowPlayerDialog(playerid, DIALOG_MSG, DIALOG_STYLE_MSGBOX, ip_name, ip_msg, "Close", "");
  return 1;
}
Reply
#2

pawn Код:
CMD:ip(playerid,params[])
{
  new targetid;
  if(!IsPlayerAdmin(playerid)) return SCM(playerid, RED, "UnKnown Command! Type /help");
  if(sscanf(params,"u", targetid)) return SCM(playerid, RED, "Getting ip of a player: /ip <playerid>");
  if(!IsPlayerConnected(targetid)) return SCM(playerid, RED, "Player is not connected");
 

  new ip[25], ip_msg[100], ip_name[MAX_PLAYER_NAME], str[24];
  GetPlayerName(playerid, ip_name,sizeof (ip_name));
  GetPlayerIp(playerid, ip,sizeof (ip));
  format(ip_msg,sizeof (ip_msg),"({FFFFFF}%s)",ip); //white color
  format(str,sizeof (str),"{FF0000}%s", ip_name);//red color

  ShowPlayerDialog(playerid, DIALOG_MSG, DIALOG_STYLE_MSGBOX, ip_name, ip_msg, "Close", "");
  return 1;
}
example for that
pawn Код:
SendClientMessage(playerid,-1,"{FF0000}test");
Use {} and put inside that your color you want http://www.colorpicker.com/
hope you understand.
Reply
#3

and also if u want different colors in SendClientMessage , use Hex code like he said,

pawn Код:
Hex = inside ""
Normal RGB color = SendClientMessage(playerid, RGB color, "text");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)