31.03.2012, 13:10
'Sup y'all?
Well, I've created a small teamchat, but I just noticed that it doesn't do what I want, lol! For example, if I'm requesting the teamchat to appear with the sign '!', it shows the message just for the team, that's right! But, everything is written in yellow, and I don't want this! I want the team displayed which is chatting with his own color, the player with his team-color and the output-text in white, just like in a normal chat! For example, if I'm in the Grove Street team now:
[Grove] PLAYERNAME: %s (text)
"[Grove]" would be in the team-color, the playername also in his team-color, and the output-text in white! This is what I currently got:
Well, I've created a small teamchat, but I just noticed that it doesn't do what I want, lol! For example, if I'm requesting the teamchat to appear with the sign '!', it shows the message just for the team, that's right! But, everything is written in yellow, and I don't want this! I want the team displayed which is chatting with his own color, the player with his team-color and the output-text in white, just like in a normal chat! For example, if I'm in the Grove Street team now:
[Grove] PLAYERNAME: %s (text)
"[Grove]" would be in the team-color, the playername also in his team-color, and the output-text in white! This is what I currently got:
pawn Код:
new string[256];
new playername[MAX_PLAYER_NAME];
if(text[0] == '!' && text[1] != 0)
{
GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
format(string,128,"[Team-Chat] %s: %s", playername,text[1] );
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[playerid] == gTeam[i])
SendClientMessage(i,COLOR_YELLOW,string);
}
return 0;
}