SA-MP Forums Archive
variable help ? - 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: variable help ? (/showthread.php?tid=376316)



variable help ? - N0FeaR - 09.09.2012

Код:
C:\Users\Hellman.Hellmans-PC\Desktop\snusk\gamemodes\P-RP.pwn(38367) : warning 219: local variable "h" shadows a variable at a preceding level
pawn Код:
line 38367      for(new h = 0; h < sizeof(Ammunation); h++)
                {
                    if(PlayerToPoint(2.0, i, Ammunation[h][0], Ammunation[h][1], Ammunation[h][2]))
                    {
                        GameTextForPlayer(i, "~w~Ammunation~n~~r~/buygun", 5000, 3);
                    }
                }
            }



Re: variable help ? - Seven_of_Nine - 09.09.2012

Check if you've defined h already somewhere.
If not, then check your includes, perhaps they have it.


Re: variable help ? - Chenko - 09.09.2012

Change "h" to something else. There is something above that line of code that already defines "h"


Re: variable help ? - jpeg - 09.09.2012

pawn Код:
for(new j = 0; j < sizeof(Ammunation); j++)
                {
                    if(PlayerToPoint(2.0, j, Ammunation[j][0], Ammunation[j][1], Ammunation[j][2]))
                    {
                        GameTextForPlayer(j, "~w~Ammunation~n~~r~/buygun", 5000, 3);
                    }
                }
            }