warning 219: local variable "players" shadows a variable at a preceding level - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 219: local variable "players" shadows a variable at a preceding level (
/showthread.php?tid=583787)
warning 219: local variable "players" shadows a variable at a preceding level -
s3ek - 31.07.2015
PHP код:
.pwn(6377) : warning 219: local variable "players" shadows a variable at a preceding level
PHP код:
stock GetPlayersInTeam(TEAM)
{
new players;
for (new i; i < GetMaxPlayers(); i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][team] == TEAM) players++;
}
}
return players;
}
Re: warning 219: local variable "players" shadows a variable at a preceding level -
youssefehab500 - 31.07.2015
This error means that 'players' is already defined. Whether change it or remove new players; both will fix it.
Re: warning 219: local variable "players" shadows a variable at a preceding level -
s3ek - 31.07.2015
i remove new players; but .. warning 213: tag mismatch
Re: warning 219: local variable "players" shadows a variable at a preceding level -
PMH - 31.07.2015
Quote:
Originally Posted by s3ek
i remove new players; but .. warning 213: tag mismatch
|
show the line
Re: warning 219: local variable "players" shadows a variable at a preceding level -
s3ek - 31.07.2015
Quote:
Originally Posted by PMH
show the line
|
return players;
Re: warning 219: local variable "players" shadows a variable at a preceding level -
KRISSTI4N - 31.07.2015
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;
}
Re: warning 219: local variable "players" shadows a variable at a preceding level -
s3ek - 31.07.2015
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