SA-MP Forums Archive
Team chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Team chat (/showthread.php?tid=444204)



Team chat - Mattakil - 15.06.2013

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



Re: Team chat - Mattakil - 15.06.2013

Lock this, idk why I posted this here, reposted under right section :S