chat help! - 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: chat help! (
/showthread.php?tid=308675)
chat help! -
Dan_Barocu - 04.01.2012
i want the t chat to be coloured like this please help me i will give rep.to people that help me!!
this is the T chat!
http://imageshack.us/photo/my-images/444/samp1o.png/ Pressing T and typing... i want it colored just like in picture please help me!i give rep. to all who help!
EDIT:I want each player to talk in this color even players in factions....
Re: chat help! -
DarkKillerWithPride<3 - 04.01.2012
Just format and string and send a message under the "OnPlayerText(playerid,text[])" function
Re: chat help! -
Dan_Barocu - 04.01.2012
how?im romanian i understand harder..
Re: chat help! -
DarkKillerWithPride<3 - 04.01.2012
should work:
pawn Код:
public OnPlayerText(playerid,text[])
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
format(text,128,"%s Says: %s",PlayerName,text);
SendClientMessageToAll(0x00E6E6FF,text);
return 1;
}
Re: chat help! -
[MG]Dimi - 04.01.2012
Quote:
Originally Posted by DarkKillerWithPride<3
should work:
pawn Код:
public OnPlayerText(playerid,text[]) { new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME); format(text,128,"%s Says: %s",PlayerName,text); SendClientMessageToAll(0x00E6E6FF,text); return 1; }
|
Wouldn't it send double message?
pawn Код:
#include <a_samp>
#define COLOR_NAME "{FF0000}" //this one is red. You add here you HEX color code
#define COLOR_TEXT "{00FF00}" //this one is green which means player's text would be green. Same, chnage it with HEX color code
public OnPlayerText(playerid,text[])
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
format(text,128,""COLOR_NAME"%s(%d) says: "COLOR_TEXT"%s",PlayerName,text);
SendClientMessageToAll(0x00E6E6FF,text);
return 0;
}
Untested. Should work.
Re: chat help! -
Dan_Barocu - 04.01.2012
warning 217: loose indentation
warning 217: loose indentation
warning 219: local variable "PlayerName" shadows a variable at a preceding level
warning 225: unreachable code
4 warnings help me fix them please.
Re: chat help! -
DarkKillerWithPride<3 - 04.01.2012
Quote:
Originally Posted by [MG]Dimi
Wouldn't it send double message?
pawn Код:
#include <a_samp>
#define COLOR_NAME "{FF0000}" //this one is red. You add here you HEX color code #define COLOR_TEXT "{00FF00}" //this one is green which means player's text would be green. Same, chnage it with HEX color code
public OnPlayerText(playerid,text[]) { new PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME); format(text,128,""COLOR_NAME"%s(%d) says: "COLOR_TEXT"%s",PlayerName,text); SendClientMessageToAll(0x00E6E6FF,text); return 0; }
Untested. Should work.
|
Yeah man sorry your correct :L was just a quick point in the right direction. Thanks for the correction man.
Re: chat help! -
Dan_Barocu - 04.01.2012
i put like this i want orange {AA3333}%s says:{0000BB}%s
{ORANGE}%s says:{LIGHTBLUE}%s where i get these?
Re: chat help! -
[ABK]Antonio - 04.01.2012
The {} colors are hex..
{RRGGBB} = Red Green Blue
{990000} = a dark red
{00CCCC} = a semi-dark cyan color...
{00FFFF} = what's in the picture most likely
Re: chat help! -
[MG]Dimi - 04.01.2012
http://www.2createawebsite.com/build/hex-colors.html Like this. Just don't copy #