04.02.2015, 22:06
Hello, i need some help with a problem please help my
When i'm trying to compile a gamemode , he said
include\progress.inc(105) : warning 219: local variable "result" shadows a variable at a preceding level
stock Float:pb_percent(Float:x, Float:widthorheight, Float:max, Float:value, direction)
{
new Float:result;
switch(direction)
{
case BAR_DIRECTION_RIGHT:
result = ((x - 3.0) + (((((x - 2.0) + widthorheight) - x) / max) * value));
case BAR_DIRECTION_LEFT:
result = ((x - 1.0) - (((((x + 2.0) - widthorheight) - x) / max) * -value)) - 4.0;
case BAR_DIRECTION_UP:
result = -((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) + 0.55);
case BAR_DIRECTION_DOWN:
result = ((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) - 0.55);
}
return result;
}
When i'm trying to compile a gamemode , he said
include\progress.inc(105) : warning 219: local variable "result" shadows a variable at a preceding level
stock Float:pb_percent(Float:x, Float:widthorheight, Float:max, Float:value, direction)
{
new Float:result;
switch(direction)
{
case BAR_DIRECTION_RIGHT:
result = ((x - 3.0) + (((((x - 2.0) + widthorheight) - x) / max) * value));
case BAR_DIRECTION_LEFT:
result = ((x - 1.0) - (((((x + 2.0) - widthorheight) - x) / max) * -value)) - 4.0;
case BAR_DIRECTION_UP:
result = -((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) + 0.55);
case BAR_DIRECTION_DOWN:
result = ((((((widthorheight / 10.0) - 0.45) * 1.02) / max) * value) - 0.55);
}
return result;
}