13.09.2012, 08:46
Hi
i have a list of id(number) how to chose an id of this with very rare case?
Example of ID
chose one of id by a random case of 1 of 50?
ok i just do this ... by add more params to myid ..
this can have more random?
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"}
};
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
}
}
}