local variable "rz" 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 "rz" shadows a variable at a preceding level (
/showthread.php?tid=634651)
local variable "rz" shadows a variable at a preceding level -
Fletcher007 - 23.05.2017
Please help me fix this warning
PHP код:
C:\Users\user\Desktop\Avenue RP -NEW UPDATE-\[X] Update\New GameMode [BETA]\World Real Life\gamemodes\edit.pwn(38948) : warning 219: local variable "rx" shadows a variable at a preceding level
C:\Users\user\Desktop\Avenue RP -NEW UPDATE-\[X] Update\New GameMode [BETA]\World Real Life\gamemodes\edit.pwn(38948) : warning 219: local variable "ry" shadows a variable at a preceding level
C:\Users\user\Desktop\Avenue RP -NEW UPDATE-\[X] Update\New GameMode [BETA]\World Real Life\gamemodes\edit.pwn(38948) : warning 219: local variable "rz" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Re: [WARNING] Please Help! -
Fletcher007 - 23.05.2017
Код:
new Float:rx[MAX_LAUNCH];
new Float:ry[MAX_LAUNCH];
new Float:rz[MAX_LAUNCH];
///////////////////////////////////
forward Firework(i);
public Firework(i)
{
new Float:x, Float:y, Float:z;
x = rx[i];
y = ry[i];
z = rz[i];
z += RocketHeight;
if (RocketExplosions[i] == 0)
{
DestroyDynamicObject(Rocket[i]);
DestroyDynamicObject(RocketLight[i]);
DestroyDynamicObject(RocketSmoke[i]);
CreateExplosion(x ,y, z, 4, 10);
CreateExplosion(x ,y, z, 5, 10);
CreateExplosion(x ,y, z, 6, 10);
}
else if (RocketExplosions[i] >= MAX_FIREWORKS)
{
for (new j = 0; j <= RocketSpread; j++)
{
CreateExplosion(x + float(j - (RocketSpread / 2)), y, z, 7, 10);
CreateExplosion(x, y + float(j - (RocketSpread / 2)), z, 7, 10);
CreateExplosion(x, y, z + float(j - (RocketSpread / 2)), 7, 10);
}
RocketExplosions[i] = -1;
FireworkTotal = 0;
Fired = 0;
return 1;
}
else
{
x += float(random(RocketSpread) - (RocketSpread / 2));
y += float(random(RocketSpread) - (RocketSpread / 2));
z += float(random(RocketSpread) - (RocketSpread / 2));
CreateExplosion(x, y, z, 7, 10);
}
RocketExplosions[i]++;
SetTimerEx("Firework", 250, 0, "i", i);
return 1;
}
Re: [WARNING] Please Help! -
Fletcher007 - 23.05.2017
Somone can help me?
Re: local variable "rz" shadows a variable at a preceding level -
Affan - 23.05.2017
Did you declare "rx" "ry" "rz" anywhere else?
Re: local variable "rz" shadows a variable at a preceding level -
saffierr - 23.05.2017
Press CTRL + F and search for 'rz'.
It means you the variable is defined more than once.
Re: local variable "rz" shadows a variable at a preceding level -
Fletcher007 - 23.05.2017
Thanks i fix it