Random(X) to pick randomly for specific numbers
#1

You can use a switch like this to get a random number:
pawn Код:
switch(random(3))
{
    case 1: // Codes
    case 2: // Codes
    case 3: // Codes
}
I know that, but how could you create a feature.
If i only want 1 and 3, i could probably do this:
pawn Код:
switch(random(3))
{
    case 1: // Codes
    case 2:
    {
        switch(random(2))
        {
            case 1: // Codes from previous case 1
            case 2: // Codes from previous case 3
        }
    }
    case 3: // Codes
}
But that would become very messy if you have alot of specific numbers like me.
Reply


Messages In This Thread
Random(X) to pick randomly for specific numbers - by CalvinC - 27.01.2015, 19:48
Re: Random(X) to pick randomly for specific numbers - by Sime30 - 27.01.2015, 19:57
Re: Random(X) to pick randomly for specific numbers - by Jefff - 27.01.2015, 20:00
Re: Random(X) to pick randomly for specific numbers - by CalvinC - 27.01.2015, 20:08
Re: Random(X) to pick randomly for specific numbers - by ball - 27.01.2015, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)