Posts: 1,046
Threads: 29
Joined: Mar 2010
pawn Код:
stock ReturnPlayerName(playerid)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
return pname;
}
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "%s (%d): {FFFFFF}%s", ReturnPlayerName(playerid), playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
You might want to use SendPlayerMessageToAll instead, so you do not have to fetch the name.
Posts: 153
Threads: 53
Joined: Oct 2010
Reputation:
0
theirs a porblem with :-
stock ReturnPlayerName(playerid)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
return pname;
}
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "%s (%d): {FFFFFF}%s", ReturnPlayerName(playerid), playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
when you talk your text is black for all players, i want random colour
Posts: 1,564
Threads: 98
Joined: Apr 2011
Reputation:
0
Thats because of the "{FFFFFF}", remove that, and it will be normal