19.10.2012, 15:33
(
Последний раз редактировалось God'Z War; 19.10.2012 в 18:10.
)
problem solved
public OnPlayerText(playerid,text[])
{
new string[128]; //Creating string of 128 cellsto output the chat.
new Lname[MAX_PLAYER_NAME]; //Creating name variable to get player's name.
GetPlayerName(playerid,Lname,sizeof(Lname)); //Executing the variable on 'GetPlayerName' function and getting player's name.
format(string,sizeof(string),"%s(ID:%d):{FFFFFF}%s", Lname, playerid, text); //Formatting the string and using Lname to output name, playerid for player's id, and text for the chat text.
new Lcolor[MAX_PLAYERS]; //Creating a variable to get player's color.
Lcolor[playerid] = GetPlayerColor(playerid); //Getting Player's color by executing our variable.
SendClientMessageToAll(Lcolor,string); //Sends the chat message to all with the color of the name first and the chat text will be in white because we've used {FFFFFF} while formatting.
return 0; //If you don't return 0, the original chat will pop out.
}