Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
Casino (w/ 10 player poker) Details »»
Casino (w/ 10 player poker)
Version: 0.92, by Andrew Green Andrew Green is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Category: Major Additions - Version: 3.6.x Rating:
Released: 09-29-2007 Last Update: 02-17-2008 Installs: 1064
DB Changes Uses Plugins Template Edits
Additional Files Is in Beta Stage  
No support by the author.

The Gameroom is the follow up to this, and expands on its features. This mod will no longer be supported, Gameroom is here: https://vborg.vbsupport.ru/showthread.php?t=219483

This is a casino addition for vBulletin, so far containing video poker, blackjack, Slots, a lottery, Let 'em Ride, Roulette and a betting pool.

It can use it's own cash as well as cash fields from other products for easy integration. Cash bonuses are also awarded for various actions (posting, starting threads, etc.), you can alter the bonus values through the admincp.

Each of the 10 games can be turned on or off through the control panel, and the casino can be restricted by user group.

I'd consider this a test run, everything should work, but some of the template's and all of the phrasing are not done yet.

Screenshots are attached.

If you want to see a demo, it's live at http://vbgaming.org, it does require registration though as it needs a userid to attach your money too Bug reports and requests can also be posted there, and will probably have less chance of getting buried in this rather massive thread. If you are having a problem, please look there. If it is one that others have been having, there will likely be a solution there (as well as in this thread, just harder to find here)

v 0.90 (Jan 6)
- Fixed a bug in lottery odds calculation that was casuing problems with the jackpot.
- Completed Phrasing of all games & admincp
- Removed card flicker some people experienced in Texas Hold'em
- Removed unused table limit setting from Video Poker settings
- Handled a DB error that occasionally came out of the slots game
- Sports Pool groups are now edited through the game, not the admincp
- Blackjack: Dealer checks for blackjack on A or 10
- Blackjack: Added Five card charlie rule
- Texas Hold'em: poker mod groups can now use the command "/kick username" to kick people out of the game. If a hand is in progress it counts as a forced fold, not returning their share of the pot.
- Blackjack - Fixed bug on bet amount when splitting more then once on a hand

v 0.91 (Jan 13)
- Added missing field for holdem mod groups to settings table
- Removed 0.90 test code of drawin same numbers in lottery
- Piped all the ajax files through casino.php, this should solve some of the conflicts people where having (ex. mkportal)
- Added missing link to add / edit groups in sports pool
- Fixed extra \'s in chatbox some users where getting
- Added a reset cash button in the ACP
- Fixed a bug where the blackjack_dealt table wasn't getting cleared properly
- Fixed "Most Lost" stat calculation


v 0.92 (Feb 18)
- Fixed Default Cash not saving
- Texas Hold'em no longer shows hand after folding
- Texas Hold'em buttons should not reappear after clicking if a request was in progress when they where clicked
- Fixed some of the reinstall issues people have been having

This is pretty minor, working on some major changes to the Texas Hold'em game that are taking longer then I planned due to other things coming up.

Known issues:
- The same player attempting to play more then one instance of the same game at the same time will cause errors.

To update overwrite all of the old files and import the product, revert any modified (casino) templates and don't forget the files in other folders Also some of the images have changed, those need uploaded again. (as well as the includes and admincp files) You DO NOT need to uninstall the previous version to upgrade, this will cause problems. Just overwrite existing files and import the product again, allowing overwrite.

**Make sure you overwrite ALL existing files and revert ALL casino templates**

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2932  
Old 04-04-2008, 04:03 AM
Shazz's Avatar
Shazz Shazz is offline
 
Join Date: Jun 2006
Location: Utah
Posts: 4,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hIBEES View Post
Acoording 1 user that's having the prob it's happening 10/10 times

firefox and bt internet default (IE)
Not if you exit out and get back in
Thats 1/10
Reply With Quote
  #2933  
Old 04-06-2008, 11:24 AM
gravy gravy is offline
 
Join Date: Mar 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to display how much money a user has on another part of my site, outside of the forums...

how do i go about this??

i believe this is the code:
Code:
$vbphrase[casino_currency_marker]$cash
Reply With Quote
  #2934  
Old 04-06-2008, 01:45 PM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For those with the "scalar" error message in slots.php, I had a similar problem with video poker.

Open the slots.php file. Find (ending on line 85):

PHP Code:
for($x=1;$x<4;$x++)
{
    
$ypos = (rand() % 6) * -75 -45;
    
$y[$x-1]= $ypos
Add ABOVE it:

PHP Code:
$y = array(); 
That should work.
Reply With Quote
  #2935  
Old 04-06-2008, 02:20 PM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A bunch of people asked about how users can track their own sports pool activity. One person mentioned PMs. This should do the trick:

*HOW TO AUTOMATICALLY PM SPORTS POOL WINNERS*

Open sportspool.php and find:

PHP Code:
<?php
...at the very top. Add this below it:

PHP Code:
function sendWinnerPM($eventname$outcome$userid$amountWon$originalBet)
{
    global 
$vbulletin;
    require_once(
'includes/class_dm.php');
    require_once(
'includes/class_dm_pm.php');

    
$botpermissions['adminpermissions'] = 1;
    
$host['userid'] = 1;
    
$host['username'] = "USERNAME";
    
$recip fetch_userinfo($userid);
    
$recipname $recip['username'];
     
$message "
        
$recip[username],

        You have just won \$
$amountWon in the Sports Pool.

        [b]Original Bet:[/b] \$
$originalBet
        [b]Event Name:[/b] 
$eventname
        [b]Winning Outcome:[/b] 
$outcome
    "
;

    
$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_SILENT);
    
$pmdm->set('fromuserid'$host['userid']);
    
$pmdm->set('fromusername'$host['username']);
    
$pmdm->set_info('receipt'false);
    
$pmdm->set_info('savecopy'false);
    
$pmdm->set('title'"Sports Pool Payout");
    
$pmdm->set('message'$message);
    
$pmdm->set_recipients($recipname$botpermissions);
    
$pmdm->set('dateline'TIMENOW);
    
$pmdm->set_info('overridequota'true);
    
$pmdm->save();

Be sure to replace these variables in the above code with your own info:
$botpermissions['adminpermissions'] = your admin userid;
$host['userid'] = userid of PM sender;
$host['username'] = "username of PM sender"; (leave the quotes)

Then find:

PHP Code:
if($result == $outcome['outcomeid'])
    
$share $outcome['totalbets'];
$total += $outcome['totalbets']; 
Replace with:

PHP Code:
if($result == $outcome['outcomeid'])
{
    
$thisOutcome $outcome['outcomename'];
    
$share $outcome['totalbets'];
}
$total += $outcome['totalbets']; 
Finally, find:

PHP Code:
$query "UPDATE " TABLE_PREFIX "user SET $cashtype = $cashtype + $w WHERE userid = $u";
$db->query($query); 
Add below:

PHP Code:
sendWinnerPM($eventname$thisOutcome$u$w$b); 
This will send a PM out to the winner(s) of each event that doesn't result in a draw. It will be executed when the event is settled in the sports pool section of the casino.

Sample PM:

Quote:
username,

You have just won $250 in the Sports Pool.

Original Bet: $50
Event Name: Baseball Game
Winning Outcome: Yankees
Reply With Quote
  #2936  
Old 04-06-2008, 04:49 PM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Andrew,

Great Job on this mod!!

Feature request: "Repeat Bet" button for Blackjack, Let It Ride, and Roulette. Carpal tunnel users are looking for relief.
Reply With Quote
  #2937  
Old 04-06-2008, 04:57 PM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, and +1 to everyone who asked for displayed results after the ball lands in Roulette. Would really be useful.

I may try to do a few other things on my own, but don't hold me to it.

1) added displays for Blackjack and Let It Ride (current bet, profit, etc.)
2) a way to request a PM with your current lottery numbers.

If they work out, I'll post the results and/or tutorials.
Reply With Quote
  #2938  
Old 04-07-2008, 09:29 AM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Our House View Post
Feature request: "Repeat Bet" button for Blackjack, Let It Ride, and Roulette.
Quote:
Originally Posted by Our House
I may try to do a few other things on my own, but don't hold me to it.

1) added displays for Blackjack and Let It Ride (current bet, profit, etc.)
Ignore my feature request for Let It Ride. I added a repeat bet button and changed the display a little to provide the players some more info:



Here's how:

Open letmeride_deal.php

Find:

PHP Code:
<?php
Add below:

PHP Code:
session_start(); 
Find:

PHP Code:
if (($bet $vcash) || ($bet $tablelimit)) 
Add above:

PHP Code:
$_SESSION['letemride_lastbet'] = $bet
Find:

PHP Code:
$playeract "<div style='font-weight:bold; text-align:center; font-size: 18pt;'>$hand<br />$vbphrase[casino_currency_marker]$cash</div>"
Replace with:

PHP Code:
$playeract "<div style='font-weight:bold; text-align:center; font-size: 18pt;'><img style='cursor:pointer;' onclick='clearbet(); placebet(\"$_SESSION[letemride_lastbet]\"); playhand()', filen);' src='casino/cards/repeatbet.png' alt='repeat bet'/><br />$hand<br />Bet: $vbphrase[casino_currency_marker]$bet<br/>Won: $vbphrase[casino_currency_marker]$cash</div>"
The button doesn't really match the others, so you might want to photoshop/paint it up a little bit.
Reply With Quote
  #2939  
Old 04-07-2008, 09:59 AM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's the Repeat Bet button/feature for Blackjack. Use the same attached image from my above post or make your own if you want.


Open the FILE blackjack_deal.php


Find:

PHP Code:
<?php
Add below:

PHP Code:
session_start(); 
Find:

PHP Code:
for($i 0$i 52$i++) {
    
$card[$i]=$i;

Add below:

PHP Code:
$_SESSION['blackjack_lastbet'] = $bet
Open the TEMPLATE casino_blackjack_play


Find:

Code:
<img  style='cursor:pointer;' src='casino/cards/clear.png' alt='$vbphrase[casino_clear]' onclick='action(11,0)'/>
Add below:

Code:
<br /><img  style='cursor:pointer;' src='casino/cards/repeatbet.png' alt='repeat bet' onclick='action(11,0); action(0,$_SESSION[blackjack_lastbet]); action(10,0)'/>
Reply With Quote
  #2940  
Old 04-07-2008, 04:51 PM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*LOTTERY TICKETS PM'D TO USERS*

This will add a link that allows your members to request a PM of their tickets before the drawing makes them disappear.






STEP ONE - Add a NEW PHRASE in your AdminCP:

Languages & Phrases -> Phrase Manager
- Select "Casino" from the dropdown
- Click "Add New Phrase"
Varname: casino_send_lottery_tickets
Text: PM Tickets To Me



STEP TWO - Open and edit the FILE lottery.php

Find:

PHP Code:
<?php

Add below (be sure to customize the adminpermission and host/sender settings!):

PHP Code:
function PMtickets($userid$username$title$message)
{
    global 
$vbulletin;
    require_once(
'includes/class_dm.php');
    require_once(
'includes/class_dm_pm.php');

    
$botpermissions['adminpermissions'] = 1//your admin userid
    
$host['userid'] = 1//userid PM is to be sent from
    
$host['username'] = "username"//username PM is to be sent from

    
$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_SILENT);
    
$pmdm->set('fromuserid'$host['userid']);
    
$pmdm->set('fromusername'$host['username']);
    
$pmdm->set_info('receipt'false);
    
$pmdm->set_info('savecopy'false);
    
$pmdm->set('title'$title);
    
$pmdm->set('message'$message);
    
$pmdm->set_recipients($username$botpermissions);
    
$pmdm->set('dateline'TIMENOW);
    
$pmdm->set_info('overridequota'true);
    
$pmdm->save();


Find:

PHP Code:
while ($ticket $db->fetch_array($tickets))
{
    
$t explode(",",$ticket['ticketnumbers']);
    
sort($t);
    
    if(
$s == 1$s 2;
        else 
$s 1;
        
    for (
$i=0;$i<$numbers;$i++)
    {    
        
$y $t[$i];
        eval(
'$yourtickets .= "' fetch_template('casino_lottery_yourtickets') . '";');
    }
    
$y NULL;
    eval(
'$yourtickets .= "' fetch_template('casino_lottery_yourtickets') . '";');


Replace with:

PHP Code:
$counter 0;
$PMtext "$username,\n\nHere are your Lottery Tickets for the next drawing:\n\n";
while (
$ticket $db->fetch_array($tickets))
{
    
$t explode(",",$ticket['ticketnumbers']);
    
sort($t);

    if(
$s == 1$s 2;
        else 
$s 1;

    for (
$i=0;$i<$numbers;$i++)
    {
        
$y $t[$i];
        
$PMnumbers .= $i == ($numbers-1) ? "[b]{$y}[/b]" "[b]{$y}[/b]-";
        eval(
'$yourtickets .= "' fetch_template('casino_lottery_yourtickets') . '";');
    }

    
$PMtext .= "Ticket ".($counter+1).": $PMnumbers\n";
    
$PMnumbers "";
    
$y NULL;
    eval(
'$yourtickets .= "' fetch_template('casino_lottery_yourtickets') . '";');
    
$counter++;
}

if (
$counter 0)
{
    
//send PM if requested
    
if ($_GET['private_message'] == "send")
    {
        
$formatted_drawdate preg_replace("/\<br\/\>/"," - ",$drawdate);
        
$PMtitle "Lottery Tickets for $formatted_drawdate";
        
PMtickets($userid$username$PMtitle$PMtext);
    }

    
$alt = (fmod($counter,2) == 0) ? 2;
    
$yourtickets .= "
        <td class='alt
$alt' colspan='$i' align='center'><a href='casino.php?do=lottery&private_message=send'>$vbphrase[casino_send_lottery_tickets]</a></td>
    "
;

Reply With Quote
  #2941  
Old 04-09-2008, 12:24 AM
peterpigman peterpigman is offline
 
Join Date: May 2006
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used the repeat bet buttons very nice ty.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06507 seconds
  • Memory Usage 2,411KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (22)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete