Can't find what I'm doing wrong!
#1

pawn Код:
if(time == 00 || time == 15 || time == 30 || time == 45)
    {
        if(drugpointcounter == 10) { drugpointcounter = 0; }
        if(drugpointcounter == 0)
        {
            for(new i=0;i<10;i++)
            {
                usednumbers[i] = 99;
            }
        }
        new rand = random(10);
        drugclear = 0;
        while(drugclear == 0)
        {
            for(new j=0;j<10;j++)
            {
                if(usednumbers[j] == rand) { rand = random(10); }
                if(usednumbers[j] != rand) { drugclear = 1; usednumbers[drugpointcounter] = rand; }
            }
        }
        MoveSmugglingPoint(rand);
        drugpointcounter++;
    }
What basically this does, it gives a random number ranged from 0 to 9.
Then second time, it gives another, but makes sure it's not any of the last ones used.
Same for the third, till it reaches 10 when it resets.
usednumbers has 9 cells, to save the used numbers, and drugpointcounter makes sure to reset it the 10th time.
It won't but, and I can't understand why!
Reply


Messages In This Thread
Can't find what I'm doing wrong! - by jimdevil13 - 17.02.2013, 10:39
AW: Can't find what I'm doing wrong! - by Nero_3D - 17.02.2013, 11:48
Re: Can't find what I'm doing wrong! - by jimdevil13 - 17.02.2013, 11:59
AW: Can't find what I'm doing wrong! - by Nero_3D - 17.02.2013, 12:29

Forum Jump:


Users browsing this thread: 1 Guest(s)