11.09.2009, 11:18
Hi I have 4 team and i want something!
If team attack onplayertext:
xCoder[Attack]: Hey!
Or id
xCoder[0]: Hey!
If team attack onplayertext:
xCoder[Attack]: Hey!
Or id
xCoder[0]: Hey!
public OnPlayerText(playerid, text[]) { new string[256], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if (gTeam[playerid] == TEAM_ATTACK) { format(string, sizeof(string), "%s[Attack]: %s", name, text[]); SendClientMessageToAll(COLOR_WHITE, string); } else if (gTeam[playerid] == TEAM_DEFENCE) { format(string, sizeof(string), "%s[Defence]: %s", name, text[]); SendClientMessageToAll(COLOR_WHITE, string); } return false; }
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;
}
Originally Posted by Don Correlli
Anwix, your code is very bad and it won't work.
|
Originally Posted by Don Correlli
Anwix, your code is very bad and it won't work.
|
Originally Posted by ZeeX
Quote:
|
Originally Posted by Anwix
Код:
format(string, sizeof(string), "%s[Attack]: %s", name, text[]); |
Originally Posted by SaiBerFun
yo don he didnt say he wants TeamChat like in only taqlk to sdum1#
he said he wants to display what team the ppl are of |