15.06.2013, 19:10
Im trying to make a chat for a team, so they can communicate with eachother(kinda like RP server's /f chat)
Here is the code:
Here are the errors
Here is the code:
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPlayerTeam(playerid) = 1)//line 186
{
new string[128],
message[100];
format(string, sizeof(string), "[Red Team] %s {%s}: %s", GetPlayerName(playerid), playerid, message);
foreach (new i : Player)
{
if(GetPlayerTeam(i) = 1)
{
SendClientMessage(i, COLYELLOW, string);
return 1;
}
}
}
if(GetPlayerTeam(playerid) = 2)
{
new string[128],
message[100];
format(string, sizeof(string), "[Blue Team] %s {%s}: %s", GetPlayerName(playerid), playerid, message);
foreach (new i : Player)
{
if(GetPlayerTeam(i) = 2)
{
SendClientMessage(i, COLYELLOW, string);
return 1;
}
}
}
return 0;
}
Код:
(186) : warning 211: possibly unintended assignment (186) : error 022: must be lvalue (non-constant) (186) : warning 215: expression has no effect (186) : error 001: expected token: ";", but found ")" (186) : error 029: invalid expression, assumed zero (186) : fatal error 107: too many error messages on one line