20.08.2014, 08:15
Cannary2048's code will work (Note change player message to client mesage)
But making a function that gets the tag from the score would be easier if you want to use them somewhere else.
But making a function that gets the tag from the score would be easier if you want to use them somewhere else.
pawn Код:
public OnPlayerText(playerid, text[])
{
new pText[160];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName,sizeof(pName));
if(GetPlayerScore(playerid) >= 1000)
{
format(pText, sizeof (pText), "{%06x}%s (ID: %d) [{FF0000}%s{FFFFFF}]: {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, pName, playerid, GetTagFromScore(playerid), text);
SendClientMessageToAll(-1, pText);
}
else
{
format(pText, sizeof (pText), "{%06x}%s (ID: %d): {FFFFFF}%s", GetPlayerColor(playerid) >>> 8, pName, playerid, text);
SendClientMessageToAll(-1, pText); // CLIENT message not PLAYER message.
// Player messages are "Name: your formatted string"
// Client messages are "your formatted string"
}
return 0;
}
GetTagFromScore(playerid)
{
new string[32];
switch(GetPlayerScore(playerid))
{
case 1000: format(string, sizeof (string), "Deadly");
case 2000: format(string, sizeof (string), "what ever you want");
// ...
}
return string;
}