21.11.2011, 12:57
Quote:
The warning indicates that a local variable shadows another variable further in the script.
Local means that the vairable is defined within a function. [...] But, let's continue. If a variable is shadowing another variable, it means that it is defining a variable which is already defined. A simple example of this would be: pawn Код:
In your case, I think you've defined "str" somewhere in your own script. You can fix the warning by opening your script, look for something along the lines of "new str;" or "new str[some number here];", and change "str" into something else. |
I'm positive this code would generate the same warning:
pawn Код:
new str[128];
main()
{
}
public OnPlayerConnect(playerid)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new str[128]; // <- warning
format(str, sizeof(str), "Hey, %s!", PlayerName);
SendClientMessage(playerid, 0xFFFFFFFF, str);
return true;
}