60+ warning
#1

I have 65 warnings.
They all look like this.
How can i fix these?

warning 219: local variable "string" shadows a variable at a preceding level
warning 219: local variable "string" shadows a variable at a preceding level
Reply
#2

You already have 'string' defined.
Reply
#3

Let me guess, the warning lines point to lines in your OnPlayerCommandText callback?
remove the "new string[...]; " from all your commands, and check if you already have that line at the beginning of the callback.
Reply
#4

Quote:
Originally Posted by Jack_Blade
Посмотреть сообщение
I have 65 warnings.
They all look like this.
How can i fix these?

warning 219: local variable "string" shadows a variable at a preceding level
warning 219: local variable "string" shadows a variable at a preceding level
Just remove the
pawn Код:
new string[128];
Upon OnGameModeInit/OnFilterScriptInit.

Cause you redefine them each command, then you had to remove the global one.
Reply
#5

Mkay, i removed there, but i didn't know how to remove from here "string"

1) public Encrypt(string[])
{
for(new x=0; x < strlen(string); x++)
{
string[x] += (3^x) * (x % 15);
if(string[x] > (0xff))
{
string[x] -= 256;
}
}
return 1;
}
2) stock asd(string[], format[], {Float,_}:...)
3)public CKLog(string[])
4)public PayLog(string[])
5)public KickLog(string[])
6)public BanLog(string[])
7)strtok(const string[], &index)
public BroadCast(color,const string[])
9)public ABroadCast(color,const string[],level)
10)public OOCOff(color,const string[])
11)public OOCNews(color,const string[])
12)public SendIRCMessage(channel, color, string[])
Reply
#6

No... I mean remove the string:

pawn Код:
new string[128]; // <<<<<< THIS ONE
Reply
#7

and whatabout the others strings?
Reply
#8

Quote:
Originally Posted by Jack_Blade
Посмотреть сообщение
and whatabout the others strings?
...


Remove the one on the top. Forget the other.
Reply
#9

look at the top of your script. there should be a
new string[...];
somewhere. Its not in a function, but at the first intendation level (if you have)

Remove that one, not the others.
Reply
#10

public LottoTimer()
{
for(new playerid=0;playerid<=MAX_PLAYERS;playerid++)
{
if(IsPlayerConnected(playerid))
{
line 3782 -- format(string, sizeof(string), "Lottery news: Lets start with loto.");
OOCOff(COLOR_WHITE, string);
new rand = random(80);
if(rand < 77) { rand += 3; }
Lotto(rand);
}
return 1;
}
}

(3782) : error 017: undefined symbol "string"
(3782) : error 017: undefined symbol "string"
(3782) : error 029: invalid expression, assumed zero
(3782) : fatal error 107: too many error messages on one line

Did like blackwave told..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)