PDA

View Full Version : Other way to chat


knackworst
02/09/2011, 07:34 PM
Hi, since my setplayercolor is bugged as hell i need another way of chatting, so i thought about this: is it possible to chat using sendclientm to all? So the text the player types will be inserted so i can use the text in a sendclientmessage to zll? So: sendcmtoall: playername: message...

Zonoya
02/09/2011, 07:41 PM
its possible but INCREDIBLY hard to do mate

Kush
02/09/2011, 07:44 PM
Hi, since my setplayercolor is bugged as hell i need another way of chatting, so i thought about this: is it possible to chat using sendclientm to all? So the text the player types will be inserted so i can use the text in a sendclientmessage to zll? So: sendcmtoall: playername: message...

Elaborate a little more.

knackworst
02/09/2011, 07:44 PM
Well as u can see in my prev discusion u can see my setplayercolor is bugged so i mustfind A different wAy to chat cuz the team will now chat, but they are the wrong color...

Kyle_Olsen
02/09/2011, 08:21 PM
If you just want to chat normally with everyone as if you type normal, use this:

public OnPlayerText(playerid, text[])
{
if(IsPlayerConnected(playerid))
{
new string[128], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s: %s", name, text);
SendClientMessageToAll(0xFFFFFFFF, string); // 0xFFFFFFFF is the color white. change it to whatever you want
}
return 0;
}

knackworst
02/09/2011, 08:29 PM
Thank you! Thts wht i needed, so i can insert html color code in the message too right?

Kyle_Olsen
02/09/2011, 08:30 PM
No, HTML code cannot be used in SA-MP chatting. PAWN and HTML are two really different code languages, and HTML only works on WEBSITES.

Alex_Obando
02/09/2011, 08:31 PM
http://bfxtylez.bf.funpic.de/PawnoColors.htm

knackworst
02/09/2011, 08:33 PM
But i thought i can use the {numbers here} color code to change the color whitin a message

Kingunit
02/09/2011, 08:37 PM
You can use those #codes from here (http://www.colorpicker.com/) Pick a color and do it like this:


#COLOR_WHITE 0xCOLORFF


For example:

#COLOR_RED 0xA10000FF


Hope you understand this above. You just need to add the 0x infront of the code and FF behind the code;)

knackworst
02/09/2011, 08:40 PM
Yes but i mean code to change color whitin a message like: (blue) hi! (red) everyone!

Kingunit
02/09/2011, 08:52 PM
That's possible the way I am doing it it's like this:
Define ontop:

//-----[0.3c Color defines]-----
#define COL_EASY "{FFF1AF}"
#define COL_DGREEN "{0E8C00}"
#define COL_LOGIN "{98E090}"
#define COL_WHITE "{FFFFFF}"
#define COL_BLACK "{0E0101}"
#define COL_GREY "{C3C3C3}"
#define COL_GREEN "{6EF83C}"
#define COL_RED "{F81414}"
#define COL_YELLOW "{F3FF02}"
#define COL_ORANGE "{F9B857}"
#define COL_LIME "{B7FF00}"
#define COL_CYAN "{00FFEE}"
#define COL_LBLUE "{298ACF}"
#define COL_BLUE "{0049FF}"
#define COL_MAGENTA "{F300FF}"
#define COL_VIOLET "{B700FF}"
#define COL_PINK "{FF00EA}"
#define COL_MARONE "{A90202}"
#define COL_CMD "{B8FF02}"
#define COL_PARAM "{3FCD02}"
#define COL_SERVER "{AFE7FF}"
#define COL_VALUE "{A3E4FF}"
#define COL_RULE "{F9E8B7}"
#define COL_RULE2 "{FBDF89}"
#define COL_RWHITE "{FFFFFF}"
#define COL_LGREEN "{9FE4AA}"
#define COL_LRED "{DA7272}"
#define COL_LRED2 "{C77D87}"
#define COL_DYELLOW "{FAFA52}"
#define COL_BROWN "{8C703F}"
#define COL_SBLACK "{474747}"
#define COL_SGREY "{ADADAD}"
#define COL_DGREY "{616161}"
#define COL_SBLUE "{3660D1}"



Example of using a SendClientMessage:

SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"This is red. "#COL_GREEN"This is green.");


Simple: Adding "#COL_GREEN" infront of a text for a green output.

knackworst
02/09/2011, 08:59 PM
Whats that color code name? So i can search for a generator or converter

Kingunit
02/09/2011, 09:01 PM
This site: http://www.colorpicker.com/
You can create a new define like I did in my previous post.
Replace the "{CODE}" to your own code from that site here above.

Amel_PAtomAXx
02/09/2011, 11:08 PM
YOu can put hex colors inside text:

public OnPlayerText(playerid, text[])
{
if(IsPlayerConnected(playerid))
{
new string[128], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s:{FFFFFF} %s", name, text); // Player name color will be same like player color when you press TAB , text will be white color
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}

Kingunit
02/09/2011, 11:57 PM
That's possible but if you define then you can use them faster. Otherwise you need to copy past the new color codes etc.