Quote:
Originally Posted by Mencent
Yes look at my example:
PHP код:
if(dialogid == 5000)
{
if(response)
{
new count,i;
for(;i<MAX_DUELS;i++)
{
if(Duel[i][DuelExiste])
{
if(listitem == count)
{
//i = ID of the Duel
return 1;
}
count ++;
}
}
}
return 1;
}
It's right
Mencent 
|
No, don't ever return a value in a loop, break the loop first and then return the value afterwards. Plus this is totally unnecessary, just store the option in a variable and then use it somewhere else.