SA-MP Forums Archive
Help please with chat - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help please with chat (/showthread.php?tid=86248)



Help please with chat - Mr_Finnigan - 12.07.2009

This works great,that is not the problem.
If Cops(green) types ;hello the chat windows says [TEAM][TLC]Bob:hello
What i want is for the team chat to be in maroon regardless of what team sends it so it would be:
[TEAM][TLC]Bob:hello


Here is the code:
Код:
public OnPlayerText(playerid, text[])
{
	if(text[0] == ';')
	{
		new string[256],name[24];
		GetPlayerName(playerid,name,24);
		format(string,256,"[TEAM] %s: %s",name,text[1]);
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if(gGroup[i] == gGroup[playerid])
				SendClientMessage(i, GetPlayerColor(playerid), string);
			}
		}
		return 0;
	}
	return 1;
}



Re: Help please with chat - Weirdosport - 12.07.2009

Then change GetPlayerColor to COLOR_YELLOW?

As in:

#define COLOR_YELLOW 0xFFFF00FF


Re: Help please with chat - Mr_Finnigan - 12.07.2009

Quote:
Originally Posted by Weirdosport
Then change GetPlayerColor to COLOR_YELLOW?

As in:

#define COLOR_YELLOW 0xFFFF00FF
Thanx i tried that before but got errors

I changed
Код:
GetPlayerColor(playerid),
to
Код:
COLOR_YELLOW(playierid),
but my problem was i didn;t need the (playerid) after COLOR_YELLOW,so thanx for helping me look further into it.


Re: Help please with chat - Correlli - 12.07.2009

pawn Код:
GetPlayerColor(playerid),
to:
pawn Код:
COLOR_YELLOW,
You can't use playerid in color define.