How do i solve this?
#1

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.
Reply
#2

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

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")
Reply
#4

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();
Reply
#5

thanks dude you are the best all warnings desappeared

thanks you really much
Reply
#6

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

thanks you really much
I'm happy I could help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)