Jump to content
MakeWebGames

Recommended Posts

Posted

With the euros around the corner, i have a mod in my backlog that I'm thinking of releasing.

A while back i made a mod that allowed you (the admin) to create betting "events". Each Event can have up to 3 outcomes with odds you define in the ACP. You set when people can bet up to and once the event is over you just simply say what outcome won and the bets are payed out.

Ive attached an example of the ACP.

Screenshot 2021-05-25 at 20.31.36.png

  • Like 5
Posted
3 hours ago, Dayo said:

It’s a European thing, it’s a big football (soccer) tournament in Europe that happens every 4 years

Your not referring about the World Cup?

  • 1 month later...
  • 2 years later...
Posted (edited)

If this module does ever get released i have the same system in torn.com but that pulls live ods etc but if you want a quick way to calculate the % of the match.

this function will only give you an example of what the % of the match outcomes based on the odds. 

function calcOds($numone, $numtwo) {
	if (!$numone || !$numtwo) {
		return false;
	}
	if (!ctype_digit($numone) && !ctype_digit($numtwo)) {
		return false;
	}
	$math = MAX(($numtwo / ($numone + $numtwo)), 0);
	return '<p>'.number_format($math, 2).' % of winning the match</p>';
}

Example Usage: 

echo calcOds(11, 100).'<br />'; // 11/100 odds
echo calcOds(100, 3).'<br />'; // 100/3 odds
echo calOds(1, 10).'<br />'; // 1/19 odds

 

Edited by SwiftGameR
Fixed added variable into the function for checking ctype_digit(var)
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...