random
#1

i am making a system with random prize...but how is it possible to make like,it is harder to earn 100k than 1k,like prizes are :1k,2k,5k,20k,100k,how could i make like 100k is harder to get than others?
Reply
#2

Well if u think there are many ways....
the simple one is this --
pawn Код:
new prize_array[] = { 1000,1000,1000,1000,2000,2000,2000,2000,3000,3000,3000,3000,100000};
//now while taking out prize -
new r = randon(sizeof(prize_array));
//now use prize_array[r] as the random prize
Now as u can see in the above method there are many 1k's,2k's etc but there is only one 100k in array this will make it harder to get 100k
Now to make it more harder add more duplicates of 1k,2k,3k....etc but only one 100k in array
Reply
#3

Here is the idea
pawn Код:
new RandomCash[] =
{
    100,
    100,
    100,
    150,
    150,
    1000
};



//then
   new Random = random(sizeof(RandomCash));
    GivePlayerMoney(playerid, RandomCash[Random]);
100$ will have the most chance to be gotten

EDIT: Too late, BroZeus already posted the solution
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)