Team chat
#1

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:
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;
    }
Here are the errors
Код:
(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
Reply


Messages In This Thread
Team chat - by Mattakil - 15.06.2013, 19:17
Re: Team chat - by WillyP - 15.06.2013, 19:20
Re: Team chat - by Mattakil - 15.06.2013, 19:26
Re: Team chat - by WillyP - 15.06.2013, 19:34
Re: Team chat - by Mattakil - 15.06.2013, 19:43
Re: Team chat - by WillyP - 15.06.2013, 20:03
Re: Team chat - by Mattakil - 15.06.2013, 20:05
Re: Team chat - by mastermax7777 - 15.06.2013, 20:27
Re: Team chat - by Mattakil - 15.06.2013, 20:58
Re: Team chat - by Mattakil - 15.06.2013, 21:04

Forum Jump:


Users browsing this thread: 1 Guest(s)