SA-MP Forums Archive
Need some assistance - 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: Need some assistance (/showthread.php?tid=576108)



Need some assistance - DarkLored - 01.06.2015

I am getting some wired error and I have no clue what I have done wrong.

Here is the code:
pawn Код:
for(new p = 0; < GetMaxPlayers(); p++)
    {
        if(Class[p] == Army) count[0]++;
        else if(Class[p] == Terrorists) count[1]++;
    }
Error:
Код:
C:\Users\DarkLored123\Desktop\Server\gamemodes\Deathmatch.pwn(229) : error 029: invalid expression, assumed zero
C:\Users\DarkLored123\Desktop\Server\gamemodes\Deathmatch.pwn(229) : error 001: expected token: ")", but found ";"
C:\Users\DarkLored123\Desktop\Server\gamemodes\Deathmatch.pwn(229) : error 036: empty statement
C:\Users\DarkLored123\Desktop\Server\gamemodes\Deathmatch.pwn(229) : fatal error 107: too many error messages on one line



Re: Need some assistance - awsomedude - 01.06.2015

Add the p in front of < sign, like so
Код:
for(new p = 0; p < GetMaxPlayers(); p++)



Re: Need some assistance - hamzajaved780 - 01.06.2015

He's right use this
Код:
        for(new p = 0; p < GetMaxPlayers(); p++)
	{
 		if(Class[p] == Army) count[0]++;
		else if(Class[p] == Terrorists) count[1]++;
	}



Re: Need some assistance - SoFahim - 01.06.2015

Some time the error line( number) is not locate the main error line. Try to understand what error really says for. Thanks.

Reply of @Hamzajaved780 can help you .