TBDev Forum
Programming board
Main Page Forum Rules Privacy Policy Members Contact Us
Welcome Guest (Login | Register)
TBDev Forum TBDev.net - Mods & hacks Mods Complete & working Blackjack Improved!

Blackjack Improved!

2008-10-04 22:43:00
Group: Member
Posts: 90
Topics participated: 33
Topics started: 4
First post: 2006-02-26 17:54:00
Last post: 2008-10-04 22:43:00
Blackjack Improved!

blackjack.php


bjstats.php


This is a re-write based on the old blackjack code. I re-wrote quite a few parts of the code. For example aces are now automatically played wither high or low. Wins and losses are kept track of as well. I also wrote a stats page with caching so users can compare their stats. I also cleaned up and improved the interface of the game quite a bit as well. After releasing this, blackjack.php quickly became the most popular page on my site, so I suspect it will work for everyone else in building their communities as well.

You can use bjstats.php however you wish. I chose to link to if from my sidebar, but you can add a link in the actual blackjack.php file if you'd like.

Be advised, there may be some lingering bugs. If you run into anything, be sure to post any fixes you may have for everyone else.

If you don't already have the basic blackjack mod, you can get the basic SQL and cards from the .

Now on with the mod!

SQL for stats:
ALTER TABLE `users` ADD `bjwins` int(10) NOT NULL default '0';
ALTER TABLE `users` ADD `bjlosses` int(10) NOT NULL default '0';


Attached: blackjack.php and bjstats.php

Because of an error in the way the forum software renders the [url=] tag within the codebox, I have decided to attach the two files as downloads rather than post them here. This makes small code fixes more difficult, but it will ensure that you guys are getting the code that I'm posting unchanged.

Enjoy!

EDIT: There was a problem with bjstats.php which has now been fixed!
EDIT 2: A new version of blackjack.php, optimized by Alex2005, has been uploaded.
 
2008-11-20 01:48:00
Group: Member
Posts: 1260
Topics participated: 596
Topics started: 26
First post: 2008-04-17 10:36:00
Last post: 2008-12-29 01:51:00
Since KrazyA1pha wasn't online a lot, i already sent him the blackjack mod to test, but he didn't saw it yet, hence not responding to my pm, so i'll post it...

like i said, the bug that gave another the winings and another the losing was fixed, and also the cheat reported by Rabbitz78 was fixed, so this time i'm pretty sure it's bug free, but i was wrong in the past, so until it will be confirmed by a few users that it works, take caution while using it, or don't make it accessable by the users yet, your choice...

you will need this sql
SQL
ALTER TABLE `blackjack` ADD `gameover` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'no';


i think i've done it, after a lot of debugging and testing, i came to the conclusion that the cheat with the back is "dead" :P

i've also removed the query that counted how many cards there are, since the cards are always 52, it was useless... and some small improvements where they where possible

fell free to test :)

ps: thanks also goes to stonebreath for testing it with his comunity ;)

attached
 

Similar threads

Topic Posts Last post
[New and Improved] Snatchlist 7 2008-06-11 00:19:00
Inactive Members - improved - 4 2008-12-31 07:42:00
Better and Improved Ajax Polls system 1 2009-01-03 06:36:00
Improved Latest Forum Posts 21 2008-10-17 12:49:00
View all site snatches using New and improved Snatchlist 30 2008-10-23 19:41:00