03.04.2012, 10:46
I want to get color of player and the text of the player will be the same color
#define white "{FFFFFF}" //at the top of script after #include
//OnPlayerText
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "(%d) %s: "white"%s", playerid, pname, text); //(%d) will be the playerid, %s will be the players name, "white"%s should be the player typed message text
SendClientMessageToAll(GetPlayerColor(playerid), string); //will sent message to everyone with players color
public OnPlayerText(playerid, text[])
{
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "(%d) %s: %s", playerid, pname, text); //(%d) will be the playerid, %s will be the players name, "white"%s should be the player typed message text
SendClientMessageToAll(GetPlayerColor(playerid), string); //will sent m
return 0;
}
// Under includes
forward TeamMessgae(team, color, string[]);
//OnPlayerText
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "Gang: %s: %s", pname, text);
TeamMessage(gTeam[playerid], COLOR HERE, string);
// Put it somewhere but not in a OTHER public
public TeamMessage(team, color, string[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(gTeam[ii] == team)
{
SendClientMessage(i, color, string);
}
}
}