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

PHP код:
.pwn(6377) : warning 219local variable "players" shadows a variable at a preceding level 
PHP код:
stock GetPlayersInTeam(TEAM)
{
    new 
players;
    for (new 
iGetMaxPlayers(); i++)
    {
        if (
IsPlayerConnected(i))
        {
            if (
PlayerInfo[i][team] == TEAMplayers++;
        }
    }
    return 
players;

Код:
line:
new players;
Reply
#2

This error means that 'players' is already defined. Whether change it or remove new players; both will fix it.
Reply
#3

i remove new players; but .. warning 213: tag mismatch
Reply
#4

Quote:
Originally Posted by s3ek
Посмотреть сообщение
i remove new players; but .. warning 213: tag mismatch
show the line
Reply
#5

Quote:
Originally Posted by PMH
Посмотреть сообщение
show the line
return players;
Reply
#6

try change "players" to "playerss" or any word:

Код:
stock GetPlayersInTeam(TEAM) 
{ 
    new playerss; 
    for (new i; i < GetMaxPlayers(); i++) 
    { 
        if (IsPlayerConnected(i)) 
        { 
            if (PlayerInfo[i][team] == TEAM) playerss++; 
        } 
    } 
    return playerss; 
}
Reply
#7

Quote:
Originally Posted by KRISSTI4N
Посмотреть сообщение
try change "players" to "playerss" or any word:

Код:
stock GetPlayersInTeam(TEAM) 
{ 
    new playerss; 
    for (new i; i < GetMaxPlayers(); i++) 
    { 
        if (IsPlayerConnected(i)) 
        { 
            if (PlayerInfo[i][team] == TEAM) playerss++; 
        } 
    } 
    return playerss; 
}
Solved thanks you +1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)