SA-MP Forums Archive
Random + Odds / Maths [PAYING $$$] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random + Odds / Maths [PAYING $$$] (/showthread.php?tid=150338)



Random + Odds / Maths [PAYING $$$] - Kyle - 25.05.2010

If i have lots of odds like, 2:1 and 3:1 and 6/1. How do i work out random like for what odd is infavour to win.

Thanks


Re: Random + Odds / Maths - ViruZZzZ_ChiLLL - 25.05.2010

pawn Код:
switch(random(3))
{
case 0:
{
/// do something here
}
case 1:
{
/// do something here
}
case 2:
/// do something here
}
}
if you know what I mean



Re: Random + Odds / Maths - Kyle - 25.05.2010

No, Look at the odds some horses are better then another horse so they have more chance of that horse winning.


Re: Random + Odds / Maths - Killa_ - 25.05.2010

pawn Код:
switch(random(9))
{
case 0,1,2,3:
{
/// do something here
}
case 4,5,6:
{
/// do something here
}
case 7,8:
/// do something here
}
}



Re: Random + Odds / Maths - Kyle - 26.05.2010

That dont help me?


Re: Random + Odds / Maths - Kyle - 26.05.2010

If someone sorts this out. And you have posts above 300+ I will Give You Ј4.00 on Paypal.


Re: Random + Odds / Maths - ViruZZzZ_ChiLLL - 26.05.2010

Quote:
Originally Posted by Mr_Tom
If someone sorts this out. And you have posts above 300+ I will Give You Ј4.00 on Paypal.
Okay, but can you at least explain a little bit clearly
I just can't understand with you only saying odds random winnings
and stuff


Re: Random + Odds / Maths - ev0lution - 26.05.2010

Quote:
Originally Posted by Mr_Tom
If someone sorts this out. And you have posts above 300+
Killed the deal right there for me.

Also...
Quote:
b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old, and it needs to have useful information about your problem.




Re: Random + Odds / Maths [PAYING $$$] - Kyle - 26.05.2010

Nah Evolution because your a sa-mp safe 'trusted' member i can make an allowance for you.

Here are four horses in the race.

H1 = 2:1
H2 = 6:1
H3 = 4:1
H4 = 9:1

Obviously the horse that is in favour to win is H1 because if you put 1 cash on you get 2 more. But with horse 4 with the odds of
9:1 that means that its hard for that horse to win. So i need to know how do i work it out on who will win.
So bassicaly the horse with the lowest odds e.g 2:1 will win.


Re: Random + Odds / Maths [PAYING $$$] - [HiC]TheKiller - 26.05.2010

pawn Код:
new HorseRand[4];
HorseRand[0] = random(3);
HorseRand[1] = random(7);
HorseRand[2] = random(5);
HorseRand[3] = random(10);
if(HorseRand[0] == 0) //Winnar lol
if(HorseRand[1] == 0) //Winnar lol
if(HorseRand[2] == 0) //Winnar lol
if(HorseRand[3] == 0) //Winnar lol
Or

pawn Код:
stock OddsToOne(Odds)
{
  new Rand = random(Odds);
  if(Odds == 1) return 1;
  if(Rand == 0) return 1;
  if(Rand != 0) return 0;
}
Returns 1 if you get the certain one.