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();