[Help] Problem with team chat
#2

Okay I had it fix to that point

Код:
    if(strcmp(cmdtext, "/team", true) == 0 || strcmp(cmdtext, "/t", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(gTeam[playerid]) return 1;
			new length = strlen(cmdtext);
		    new idx;
		    new string[128], playername[30];
		    GetPlayerName(playerid, playername, sizeof(playername));
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[256];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/t)eam [team chat]");
				return 1;
			}
		   	if(gTeam[playerid] == TEAM_CT)
		   	{
		   	    format(string, sizeof(string), "** %s: %s **",playername(playerid), result);
                SendClientMessage(playerid, CT_COLOR, string);
   			}
   			else if(gTeam[playerid] == TEAM_TT)
		   	{
		   	    format(string, sizeof(string), "** %s: %s **",playername(playerid), result);
                SendClientMessage(playerid, TT_COLOR, string);
   			}
		}
		return 1;
	}
Still need to fix those errors.

Код:
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(445) : error 012: invalid function call, not a valid address
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(445) : warning 215: expression has no effect
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(445) : error 001: expected token: ";", but found ")"
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(445) : error 029: invalid expression, assumed zero
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(445) : fatal error 107: too many error messages on one line
Line 445 is this one:
Код:
 format(string, sizeof(string), "** %s: %s **",playername(playerid), result);
                SendClientMessage(playerid, CT_COLOR, string);
Reply


Messages In This Thread
[Help] Problem with team chat - by alainchaccour - 21.10.2011, 10:27
Re: [Help] Problem with team chat - by alainchaccour - 21.10.2011, 10:52
Re: [Help] Problem with team chat - by nilanjay - 21.10.2011, 10:57
Re: [Help] Problem with team chat - by alainchaccour - 21.10.2011, 10:59
Re: [Help] Problem with team chat - by alainchaccour - 21.10.2011, 11:28

Forum Jump:


Users browsing this thread: 1 Guest(s)