local variable "playerid" 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: local variable "playerid" shadows a variable at a preceding level (
/showthread.php?tid=495405)
local variable "playerid" shadows a variable at a preceding level -
mpio - 17.02.2014
Please heelp
Re: local variable "playerid" shadows a variable at a preceding level -
Flake. - 17.02.2014
On line 1534 you're trying to define 'playerid' and it's already defined as a global variable
Re: local variable "playerid" shadows a variable at a preceding level -
JJB562 - 17.02.2014
Why are you attempting to loop through all players in OnPlayerUpdate? OnPlayerUpdate gets called with all players regardless, so you can remove the loop:
pawn Код:
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{
Also don't forget to remove the closing brace, along with fixing the indentation.
Re: local variable "playerid" shadows a variable at a preceding level -
mpio - 17.02.2014
Thank you.