warning 219: local variable "i" shadows a variable at a preceding level
#1

how to fix this warning


code:
PHP Code:
foreach(Player,i) if(PlayerInfo[i][pAdmin] >= && i!= playerid && a_Level(i) >= a_Level(playerid)) SendClientMessage(i,COLOR_STEELBLUE,str2); 
Reply
#2

Try it this way.

Code:
foreach(Player,i) if(PlayerInfo[i][pAdmin] >= 1 && (i != playerid) && a_Level(i) >= a_Level(playerid)) SendClientMessage(i,COLOR_STEELBLUE,str2);
__

I'm sorry for my bad English.
Reply
#3

"i" has been declared above. Simple, re-name "i" to some other name (such as "p") and also change the syntax to the newer one:
pawn Code:
foreach(new p : Player)
Reply
#4

Quote:
Originally Posted by Konstantinos
View Post
"i" has been declared above. Simple, re-name "i" to some other name (such as "p") and also change the syntax to the newer one:
pawn Code:
foreach(new p : Player)
yes thanks man SLOVED.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)