SA-MP Forums Archive
How do i solve this? - 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: How do i solve this? (/showthread.php?tid=119163)



How do i solve this? - Hailine - 06.01.2010

hi after compiling my GM
it appears like 9 warnings saying the same thing but in different lines
the warings are

Quote:

shadows a variable at a preceding level

plz can someone tell me whats going on there
and how to solve it.



Re: How do i solve this? - ClanDBZVegeta - 06.01.2010

could u showus the script/line where this error occurs?
btw,
wrong section.


Re: How do i solve this? - Hailine - 06.01.2010

Quote:
Originally Posted by ClanDBZVegeta
could u showus the script/line where this error occurs?
btw,
wrong section.
(376) : warning 219: local variable "X" shadows a variable at a preceding level
and
(204) : warning 235: public function lacks forward declaration (symbol "SendMSG")


Re: How do i solve this? - BP13 - 06.01.2010

shadows a variable at a preceding level means that its already defined within or out of a function. Example:

pawn Код:
new string[128]; //Defined outside
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
      new string[128]; //Defined Inside; Twice = Preceding Level
      format(string, sizeof(string), "Your Name Is %s");
      SendClientMessage(playerid, 0x33CCFFAA, string);
        return 1;
    }
    return 0;
}
Код:
C:\Documents and Settings\User\Desktop\Untitled.pwn(94) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\User\Desktop\Untitled.pwn(236) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
It also includes it if its defined already in a include file.



(376) : warning 219: local variable "X" shadows a variable at a preceding level
and

- So Get rid of "X"


(204) : warning 235: public function lacks forward declaration (symbol "SendMSG")

forward SendMSG();


Re: How do i solve this? - Hailine - 06.01.2010

thanks dude you are the best all warnings desappeared

thanks you really much


Re: How do i solve this? - BP13 - 06.01.2010

Quote:
Originally Posted by Hailine
thanks dude you are the best all warnings desappeared

thanks you really much
I'm happy I could help