for(new idx=0; idx<MAX_DOORS; idx++)
local variable "idx" shadows a variable at a preceding level
new idx=1, File:file;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
for(new idx=0; idx<MAX_DOORS; idx++)
new idx=1
You must have that variable defined somewhere else in that area of the script or you have a global variable with that name.
|
new idx = 0;
ThisCouldBeAnyFunction(functionparameter)
{
for(new idx = 0; idx < MAX_DOORS; idx++)
{
// It will give that warning because "idx" is already defined as global variable ( A variable which isn't created in any function. )
}
return 1;
}
ThisCouldBeAnyFunction(functionparameter)
{
new idx = 0;
/*
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.
loads of code, but all in the same function.*/
for(new idx = 0; idx < MAX_DOORS; idx++)
{
// It will give that warning because "idx" is already defined as local variable ( A variable which is created in the same function. )
}
return 1;
}
ThisCouldBeAnyFunction(functionparameter)
{
for(new idx = 0; idx < MAX_DOORS; idx++)
{
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
}
return 1;
}
ThisCouldBeAnyFunction(functionparameter)
{
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
for(new idx = 0; idx < MAX_DOORS; idx++)
{
break;
}
return 1;
}