The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vBookie for vBulletin 3.5 Details »» | |||||||||||||||||||||||||
vBookie
Introduction This is a Port of the original vBookie Hack created by tdjrico; full credits to him for the idea and the kind permission to port his work A t t e n t i o n This Hack is unsopported and incompatible with vBulletin 3.6+ You are hereby advised to not use it. Please do not ask me about support and/or updates - there will be none. Supporters / CoAuthors Show Your Support
|
Comments |
#712
|
|||
|
|||
Quote:
|
#713
|
|||
|
|||
It would be great if someone could figure this out...
Can the winnings or losses from each event posted be deducted or added acordingly to the event outome,from the member's vCash who posted that event.anyone??? |
#714
|
|||
|
|||
Quote:
Anyway, if you're happy to modify php files I can post the code for you. |
#715
|
|||
|
|||
Quote:
great!please do share that piece of of code.thanks alot!:banana: |
#716
|
|||
|
|||
Quote:
|
#717
|
|||
|
|||
Here's the mod to make money bet on vbookie events go to the bookie, and to have any winnings paid out from the bookies money. If the bookie can't afford to pay the winnings, their cash is set to zero. If you're using vbbux, money will be taken from the bank if possible.
Backup your files before making these changes! I've only tested this on my own site (3.5.4), so proceed with caution! First, open includes/functions_vbookie.php and find: Code:
?> Code:
// psybernaut mod function vbookie_take_bookie_cash($userid, $amount) { global $vbulletin; $bookie = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=$userid"); switch ($vbulletin->options['vbookiecash']) { case 'vcash': if($amount > $bookie['vbookie_cash']) { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=0 WHERE userid=$userid"); } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbookie_cash=vbookie_cash-$amount WHERE userid=$userid"); } break; case 'ucash': if($amount > $bookie['ucash']) { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=0 WHERE userid=$userid"); } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ucash=ucash-$amount WHERE userid=$userid"); } break; case 'ebux': if($amount > $bookie['ebux']) { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=0 WHERE userid=$userid"); } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET ebux=ebux-$amount WHERE userid=$userid"); } break; case 'custom': ($hook = vBulletinHook::fetch_hook('vbookie_take_bookie_cash')) ? eval($hook) : false; } } Code:
// actually pay the money ;) vbookie_give_user_cash($bet['userid'], $amount_to_pay); Code:
// psybernaut's mod vbookie_take_bookie_cash($threadinfo['postuserid'], $amount_to_pay); Code:
vbookie_take_user_cash($total_stake); Code:
// psybernaut's mod vbookie_give_user_cash($threadinfo['postuserid'], $total_stake); Open includes/xml/hooks_bookiehack.xml and find: Code:
<hook>vbookie_take_user_cash</hook> Code:
<hook>vbookie_take_bookie_cash</hook> Product: vBulletin Hook Location: vbookie_take_bookie_cash Title: vBookie With vbPlaza - Take Bookie Cash Plugin PHP Code: Code:
// take the bookies money $bookie = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE userid=$userid"); if($amount > $bookie['vbbux']) { $amount = $amount - $bookie['vbbux']; $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=0 WHERE userid=$userid"); if($amount > $bookie['vbbank']) { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbank=0 WHERE userid=$userid"); } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbank=vbbank-$amount WHERE userid=$userid"); } } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET vbbux=vbbux-$amount WHERE userid=$userid"); } I've made another fix for timezones that are not a round integer (we live in a +9.5 timezone and it caused some issues that needed fixing). I'd be interested in putting out a new release with this fixe in it and the above mod included in a tidier form (eg. admin option to turn it on/off etc). Can anyone point me to some info on how to go about taking over responsibility for this mod, that's assuming Andreas is willing to hand it over of course... I'm not looking to step on toes EDIT: Updated the vbbux hook to deduct money from the bookie's bank account if they don't have enough cash on hand. |
#718
|
|||
|
|||
Excellent....thanks for this.....when (if) you take this over from Andreas , could you add in a maximum bet feature ?
|
#719
|
||||
|
||||
will that bookie thing work with vcash too, psybernaut?
I do not know how to install vbux/ucash.. but my vbookie seems to be working with vcash. I would like to have a promotion, see which bookie can make the most virtual dollars CatsGot9 |
#720
|
|||
|
|||
*edited
|
#721
|
||||
|
||||
I deleted a thread that had a bet in it.. now the bet stays there inactive. How can I remove this from vbookie?
CatsGot9 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|