Quote:
Originally Posted by ezurick
Hi... Great program/plugin! I have been using this for several months and love it... but I am running into issues that are within the program that I can't change. I am running vbookie 1.0.7 and vb 3.6.8... and I am using the vbCredits 1.4.
I had a recent issue with one of my vbCredits settings and many of my members earned like 2K a post or reply. I quickly resolved the settings... but now I have a few users (that were posting at that time) with large balances... Anyway, I had my football odds set at 5 to 1... This gave many new users an opportunity to bet small and win a nice pot to play arcade and such... I recently had 2 users (same person with different accounts) bet 20K on the 5 to 1... on both the win and lose... So they of course will win a million either way. There is absoultely no way to change that odds... cause if I change the odds, their odds remain the same... and there is no way to limit their bets. I need a way to limit any bet... this is extremely important and I can't understand why others haven't asked this... I have no way to change members bets either... So now I am stuck with allowing this bet to continue, or close it down and I don't want to do that... there are too many other members with proper bets and odds... Any help?
|
Actually, there is too a way to set a cap limit on bets and it was explained within this thread.
Here is how you do it, simply add a conditional within the conditional to test the value of each bet (eval each $stake variable with the loop).. this simple if statement will work fine and do the trick..
PHP Code:
if ($stake > 1000){
eval(standard_error(fetch_error('vbookie_exceeded_max_bet')));
}
So ... do this (when you have time that is)..
Edit File vbookie.php.
Find:
PHP Code:
foreach ($vbulletin->GPC['option'] AS $option_id => $stake)
{
if ($stake > 0)
{
$db->query_write("INSERT INTO " . TABLE_PREFIX . "vbookie_bets_placed (option_id, item_id, userid, bet_amount_placed, bet_odds_against, bet_odds_for, bet_private) VALUES ($option_id, $item_id, " . $vbulletin->userinfo['userid'] . ", $stake, " . $odds_against["$option_id"] . ", " . $odds_for["$option_id"] . ", '$private')");
$db->query_write("UPDATE " . TABLE_PREFIX . "vbookie_item_options SET option_n_bets_placed=option_n_bets_placed+1, option_amount_staked=option_amount_staked+$stake WHERE option_id=$option_id");
}
}
Replace with:
PHP Code:
foreach ($vbulletin->GPC['option'] AS $option_id => $stake)
{
if ($stake > 0)
{
if ($stake > 1000){
eval(standard_error(fetch_error('vbookie_exceeded_max_bet')));
}
$db->query_write("INSERT INTO " . TABLE_PREFIX . "vbookie_bets_placed (option_id, item_id, userid, bet_amount_placed, bet_odds_against, bet_odds_for, bet_private) VALUES ($option_id, $item_id, " . $vbulletin->userinfo['userid'] . ", $stake, " . $odds_against["$option_id"] . ", " . $odds_for["$option_id"] . ", '$private')");
$db->query_write("UPDATE " . TABLE_PREFIX . "vbookie_item_options SET option_n_bets_placed=option_n_bets_placed+1, option_amount_staked=option_amount_staked+$stake WHERE option_id=$option_id");
}
}
Then all that is left it to Create the Phrase
languageid : -1
varname : vbookie_exceeded_max_bet
text : You have exceeded the maximum amount of $1000 per bet.
phrasetypeid : 1000
product : bookiehack
Obviously, the $1000 max can be changed to what ever the heck you want it to be... I've taken it farther and an interface that allows the creator of the event to set a cap on it (Cap per event).... and no, it won't be released, so please don't ask.
Again, this isn't MY solution, it was posted in this thread. Search is a wonderful tool.. use it.