if-goto
#7

pawn Код:
reselect:
if(last_RandomMessage == RandomSelection) {

    //Oh no! The random selected the same message as before! This is where we make it select again and again until it gets a different message!
    //To do this, we just simply create the random again!
    RandomSelection = random(3);
    printf("test");
    if(last_RandomMessage == RandomSelection) goto reselect;
    last_RandomMessage = RandomSelection;
    printf("test passed");
    //We do not return here, because we would like to let the rest of the code run.
}
make sure you don't cheat the variables anywhere....
Reply


Messages In This Thread
if-goto - by 2KY - 17.01.2012, 02:38
Re: if-goto - by Scenario - 17.01.2012, 02:42
Re: if-goto - by Kar - 17.01.2012, 02:47
Re: if-goto - by 2KY - 17.01.2012, 02:51
Re: if-goto - by Kar - 17.01.2012, 02:51
Re: if-goto - by 2KY - 17.01.2012, 03:00
Re: if-goto - by Kar - 17.01.2012, 03:18
Re: if-goto - by cessil - 17.01.2012, 03:35
Re: if-goto - by Scenario - 17.01.2012, 03:46
Re: if-goto - by Babul - 17.01.2012, 03:54

Forum Jump:


Users browsing this thread: 1 Guest(s)