Very rare Random
#1

Hi

i have a list of id(number) how to chose an id of this with very rare case?
Example of ID
pawn Код:
new myid[][myidinfo] = {
    { 10, "name"},
    { 25, "name"},
    { 2, "name"},
    { 50, "name"},
    { 51, "name"},
    { 40, "name"}
};
chose one of id by a random case of 1 of 50?


ok i just do this ... by add more params to myid ..

pawn Код:
new size = sizeof(myid);
new random = random(size);
if(myid[random][canbecounted] != 0) {
    if(myid[random][Random] > 0) { //new param Random 0-10
        switch(random(myid[random][Random])) {
            case 0..4: you loose
            case 5..7: you loose
            case 8..9: you loose
            case 10: you win
            case 11..21: you loose
            case 22..44: you loose
            case 50: you win
            case 45..49: you loose
        }
    }
}
this can have more random?
Reply
#2

Use a random stock
and cases
Reply
#3

Nice help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)