SA-MP Forums Archive
Error code's by SetPlayerToTeamColor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error code's by SetPlayerToTeamColor (/showthread.php?tid=423577)



Error code's by SetPlayerToTeamColor - Lorenzosdm - 18.03.2013

I get this error code's when i'm trying to create team colors:

Код:
C:\Users\Lorenzo\Desktop\DM server\gamemodes\LSGTDM.pwn(132) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Lorenzo\Desktop\DM server\gamemodes\LSGTDM.pwn(132 -- 133) : error 028: invalid subscript (not an array or too many subscripts): "playerid"
C:\Users\Lorenzo\Desktop\DM server\gamemodes\LSGTDM.pwn(132 -- 134) : error 001: expected token: "}", but found "if"
C:\Users\Lorenzo\Desktop\DM server\gamemodes\LSGTDM.pwn(132 -- 134) : fatal error 107: too many error messages on one line
and this are the lines:

Код:
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_CRAZY);
	{
		SetPlayerColor(playerid, TEAM_CRAZY_C);
	}
	else if (gTeam[playerid] == TEAM_BEAST);
	{
		SetPlayerColor(playerid, TEAM_BEAST_C);
	}
	return 1;
}
Thanks for the help!


Re: Error code's by SetPlayerToTeamColor - Denying - 18.03.2013

After a 'if' statement, you don't need to use a coma. Remove it.


Re: Error code's by SetPlayerToTeamColor - Lorenzosdm - 18.03.2013

Nop doesn't work :l