SA-MP Forums Archive
[Error]Script GameMode - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Error]Script GameMode (/showthread.php?tid=113599)



[Error]Script GameMode - waim - 14.12.2009

Код:
public SetPlayerTeamFromClass(playerid, classid)
{
 	if (classid == 1
	{
		gTeam[playerid] = TEAM_VAGOS;
	}
 	if (classid == 2
	{
		gTeam[playerid] = TEAM_VAGOS;
	}
 	if (classid == 3
	{
		gTeam[playerid] = TEAM_VAGOS;
	}
 	if (classid == 4
	{
		gTeam[playerid] = TEAM_BALLAS;
	}
	if (classid == 5
	{
		gTeam[playerid] = TEAM_BALLAS;
	}
 	if (classid == 6
	{
		gTeam[playerid] = TEAM_BALLAS;
	}
 	if (classid == 7
	{
		gTeam[playerid] = TEAM_BALLAS;
	}
 	if (classid == 8
	{
		gTeam[playerid] = TEAM_AZTECAS;
	}
 	if (classid == 9
	{
		gTeam[playerid] = TEAM_AZTECAS;
	}
 	if (classid == 10
	{
		gTeam[playerid] = TEAM_AZTECAS;
	}
 	if (classid == 11
	{
		gTeam[playerid] = TEAM_GROVE;
	}
	if (classid == 12
	{
		gTeam[playerid] = TEAM_GROVE;
	}
	if (classid == 13
	{
		gTeam[playerid] = TEAM_GROVE;
	}
}
-Errors
Код:
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(170) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(174) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(178) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(182) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(186) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(194) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(198) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(202) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(206) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(210) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(214) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Mes documents\Downloads\Compressed\samp03asvr_R3_win32\gamemodes\waim.pwn(218) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


13 Errors.
code]



Re: [Error]Script GameMode - Correlli - 14.12.2009

You need to close the if-statement.

Wrong:
pawn Код:
if (classid == 13
Correct:
pawn Код:
if (classid == 13)



Re: [Error]Script GameMode - Tigerbeast11 - 14.12.2009

Quote:
Originally Posted by Don Correlli
You need to close the if-statement.

Wrong:
pawn Код:
if (classid == 13
Correct:
pawn Код:
if (classid == 13)
also, im not sure but would u need a else if?

pawn Код:
if (classid == 13)
to

pawn Код:
else if (classid == 14)