This is the dirty, "hey it works!" version, I'm sure you or someone else can vastly improve upon it with error checking and other features. This does not include a way to reward the winner of the tournament with their own bounty.
Step 1
Head over to the https://www.briggsoft.com/docs/pmavens/ ... m#callback for Poker Mavens and grab the Callback example code and create a file in your root folder called callback.php.
Step 2
Turn on Callback Events in the System tab of your Poker Mavens client. Next in the URL field, enter the URL to your callback.php file and a password below. Be sure to put the password you selected into the callback.php file itself where it indicates it should be at the top of the file.
Step 3
Turn on all the Callback Events you want, but you must turn on Tournament knockout event for this to work.
Step 4
Insert this code below, or your own modified version, into the callback.php file where you see case "TourneyKnockout":, just under fwrite($f,"\n");
case "TourneyKnockout":
fwrite($f,"Event = " . $event . "\n");
fwrite($f,"Name = " . $_POST["Name"] . "\n");
fwrite($f,"Table = " . $_POST["Table"] . "\n");
fwrite($f,"Player = " . $_POST["Player"] . "\n");
fwrite($f,"Bounty = " . $_POST["Bounty"] . "\n");
fwrite($f,"Hand = " . $_POST["Hand"] . "\n");
fwrite($f,"Time = " . $_POST["Time"] . "\n");
fwrite($f,"\n");
Code: Select all
// assign vars
$TourneyName = $_POST["Name"];
$kodplayer = $_POST["Player"];
$BountyPlayer = $_POST["Bounty"];
// get tourney info
$params = array("Command" => "TournamentsGet", "Name" => $TourneyName);
$api = Poker_API($params);
$result = $api -> Result;
// get entry fee amount
$bountyamt = $api -> EntryFee;
// award the entryfee amount to the player who KO'd someone
$params = array("Command" => "AccountsIncBalance", "Player" => $BountyPlayer, "Amount" => $bountyamt);
$api = Poker_API($params);
$result = $api -> Result;
That's it! You now have KO Tournaments by simply using the Entry Fee for a tournament as the Bounty on each player. Please keep in mind that if you use Entry Fee's on your site for other tournaments you will need to put in a way to distinguish between your KO tourneys and those you simply want to collect an entry fee on. Perhaps searching the Tourney Name for "KO" or "Knockout" and only running this if it's found.
Something else you can do is have a Discord Bot (Webhook) post to a channel when someone knocks someone else out and show the names, the tourney name and the Bounty won. I will post that code in another How To message since the Discord Bot can be used many different ways. That code will simply go directly below this code and before the break;.
If you are a Developer and you see that I've done something completely wrong or in a naive way that could be better, feel free to correct me ... I need to learn!