SA-MP Forums Archive
Error and Warning ! - 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 and Warning ! (/showthread.php?tid=296806)



Error and Warning ! - dorperez - 13.11.2011

C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(1489) : error 008: must be a constant expression; assumed zero
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10781) : warning 219: local variable "i" shadows a variable at a preceding level
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10786) : warning 219: local variable "i" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Line 1489:

new LuX_ReadPlayerPosition[PLAYERS][ReadPositions];


Line 10781:

for (new i=0; i < p; i++) {

Line 10786:

for(new i; i<MAX_PLAYERS; i++)


Tnx !


Re: Error and Warning ! - TheLazySloth - 13.11.2011

warning 219: local variable "i" shadows a variable at a preceding level
That error means you have two variables that are the same, in this case i

error 008: must be a constant expression; assumed zero
One of the arrays (probably PLAYERS) isn't defined.


Re: Error and Warning ! - Juniior - 13.11.2011

You didn't close the first for loop type instruction.

pawn Код:
main()
{
    for(new i = 1; i > 0; i++)
    {
        print("debug");
    }
    for(new i = 1; i > 0; i++)
    {
        print("debug");
    }

}



Re: Error and Warning ! - dorperez - 13.11.2011

Tnx !