Code
#define red "{FF002B}"
#define pink "{FF00D9}"
#define purple "{DFA7F2}"
#define blue "{A1C2FF}"
#define green "{3DE3B1}"
#define yellow "{FAF623}"
#define black "{69670C}"
#define orange "{F2C80C}"
#define ice "{03F2FF}"
#define lime "{00FF40}"
Code
// Remember that 10 is the amount of colors that is on the array. You need to change according you add new colors!
static title[][10] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};
static message[][10] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};
static id[][10] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};
Code
public OnPlayerText(playerid, text[])
{
// Make the changes according you like. I did this on my script as I like
new rand = random(sizeof(title)); // Random from array 'title'
new rand2 = random(sizeof(id)); // Random from array 'id'
new rand3 = random(sizeof(message)); // Random from array 'message'
static name[MAX_PLAYER_NAME],string[128]; // Defining the 'string' and the 'name'
GetPlayerName(playerid,name,sizeof(name)); // Here, we get the player name
format(string,sizeof(string),"%s%s %s(%d): %s%s",title[rand][0],name,id[rand2][0],playerid,message[rand3][0],text); // formating the string which will be sent
SendClientMessageToAll(color, string); // Here we send the string for all :P
return 0; // Dont forget that
}
title[rand][0] = Gets a random color from the array 'title'
name = Player name, gotten from the array 'name'
id[rand2][0] = Gets a random color from the array 'id'
playerid = the player ID (Number in this case)
message[rand3][0] = Gets a random color from the array 'message'
text = The text which the player has typed
Автор: blackwave