Foreach skipping, switch cases.
#2

You could do something like this:

pawn Код:
new checked = 0;

foreach(new i : Player)
{
    switch(whatever_var)
    {
        case 1:
        {
            //does whatever
            //happens fully, like loops normally as foreach does.
        }
        case 2:
        {
            if(checked == 0)
            {
                checked = 1;
                //does whatever
                //occurs once, foreach does not loop through this case more than once <== That is the question, how to make that possible
            }
        }
    }
}
Sorry about the indentation, the forum messes it up.
Reply


Messages In This Thread
Foreach skipping, switch cases. - by iReacheR - 11.05.2015, 09:42
Re: Foreach skipping, switch cases. - by Nicker - 11.05.2015, 09:56

Forum Jump:


Users browsing this thread: 2 Guest(s)