11.09.2009, 12:05
Anwix, your code is very bad and it won't work.
Use this:
Use this:
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(gTeam[playerid] == TEAM_ATTACK)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
format(string, sizeof(string), "%s [Attack]: %s", name, text);
SendClientMessage(i, COLOR_WHITE, string);
}
}
}
else if(gTeam[playerid] == TEAM_DEFENCE)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
format(string, sizeof(string), "%s [Defence]: %s", name, text);
SendClientMessage(i, COLOR_WHITE, string);
}
}
}
return 0;
}