ip - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ip (
/showthread.php?tid=470494)
ip -
Another1 - 18.10.2013
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;
}
Re: ip -
SilentSoul - 18.10.2013
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.
Re: ip -
newbie scripter - 18.10.2013
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");