pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
if(!hasDied[playerid]) {
if(gTeam[playerid] == TEAM_GROVE) {
format(string, sizeof(string), "{00FF00}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
for(new i; i>playersOnlineCount; i++) {
if(gTeam[playerid] == gTeam[i])
{
format(string, sizeof(string), "{00FF00}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
SendClientMessage(i, 0xFFFFFFFF, string);
}
}
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else if(gTeam[playerid] == TEAM_BALLA) {
format(string, sizeof(string), "{FF00FF}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
for(new i; i>playersOnlineCount; i++) {
if(gTeam[playerid] == gTeam[i])
{
format(string, sizeof(string), "{FF00FF}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
SendClientMessage(i, 0xFFFFFFFF, string);
}
}
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
} else {
format(string, sizeof(string), "{808080}%s: {FFFFFF}%s", COLOR_GREY,name,COLOR_WHITE, text);
for(new i; i>playersOnlineCount; i++) {
if(hasDied[i]) {
format(string, sizeof(string), "{808080}%s: {FFFFFF}%s", COLOR_GREY,name,COLOR_WHITE, text);
SendClientMessage(i, 0xFFFFFFFF, string);
}
}
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
return 0;
}
That is my code, and theoretically, if I join the server under the name of "James" and say "Hello!", and join under the Grove team, I should get this message:
it is because you only have two placeholders and four vars at the end of the format. change the colours etween curly brackets to the hexx placeholder... i dont have a fucking percent key on ma phone...
Ah crap, I'm stupid. Sorry, lock this please.