View Single Post
  #1  
Old 15th August 2008, 18:52
Krypto Krypto is offline
Retired from BVList
 
Join Date: Jan 2008
P2P
Posts: 510
Exclamation [TSSE 5.1] Casino
Code:
CREATE TABLE `blackjack` (
`userid` int(11) NOT NULL default '0',
`points` int(11) NOT NULL default '0',
`status` enum('playing','waiting') NOT NULL default 'playing',
`cards` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`userid`)
) ENGINE=MyISAM;

CREATE TABLE `cards` (
`id` int(11) NOT NULL auto_increment,
`points` int(11) NOT NULL default '0',
`pic` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;

-- 
-- Dumping data for table `cards`
-- 

INSERT INTO `cards` (`id`, `points`, `pic`) VALUES
(1, 2, '2p.bmp'),
(2, 3, '3p.bmp'),
(3, 4, '4p.bmp'),
(4, 5, '5p.bmp'),
(5, 6, '6p.bmp'),
(6, 7, '7p.bmp'),
(7, 8, '8p.bmp'),
(8, 9, '9p.bmp'),
(9, 10, '10p.bmp'),
(10, 10, 'vp.bmp'),
(11, 10, 'dp.bmp'),
(12, 10, 'kp.bmp'),
(13, 1, 'tp.bmp'),
(14, 2, '2b.bmp'),
(15, 3, '3b.bmp'),
(16, 4, '4b.bmp'),
(17, 5, '5b.bmp'),
(18, 6, '6b.bmp'),
(19, 7, '7b.bmp'),
(20, 8, '8b.bmp'),
(21, 9, '9b.bmp'),
(22, 10, '10b.bmp'),
(23, 10, 'vb.bmp'),
(24, 10, 'db.bmp'),
(25, 10, 'kb.bmp'),
(26, 1, 'tb.bmp'),
(27, 2, '2k.bmp'),
(28, 3, '3k.bmp'),
(29, 4, '4k.bmp'),
(30, 5, '5k.bmp'),
(31, 6, '6k.bmp'),
(32, 7, '7k.bmp'),
(33, 8, '8k.bmp'),
(34, 9, '9k.bmp'),
(35, 10, '10k.bmp'),
(36, 10, 'vk.bmp'),
(37, 10, 'dk.bmp'),
(38, 10, 'kk.bmp'),
(39, 1, 'tk.bmp'),
(40, 2, '2c.bmp'),
(41, 3, '3c.bmp'),
(42, 4, '4c.bmp'),
(43, 5, '5c.bmp'),
(44, 6, '6c.bmp'),
(45, 7, '7c.bmp'),
(46, 8, '8c.bmp'),
(47, 9, '9c.bmp'),
(48, 10, '10c.bmp'),
(49, 10, 'vc.bmp'),
(50, 10, 'dc.bmp'),
(51, 10, 'kc.bmp'),
(52, 1, 'tc.bmp');

CREATE TABLE `casino` (
`userid` int(10) NOT NULL default '0',
`win` bigint(20) default NULL,
`lost` bigint(20) default NULL,
`trys` int(11) NOT NULL default '0',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`enableplay` enum('yes','no') NOT NULL default 'yes',
`deposit` bigint(20) NOT NULL default '0',
PRIMARY KEY (`userid`)
) ENGINE=MyISAM;

CREATE TABLE `casino_bets` (
`id` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) NOT NULL default '0',
`proposed` varchar(40) NOT NULL default '',
`challenged` varchar(40) NOT NULL default '',
`amount` bigint(20) NOT NULL default '0',
`time` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `userid` (`userid`,`proposed`,`challenged`,`amount`)
) ENGINE=MyISAM;
And if you want it as a plugin, Create a plugin with this code inside.

Code:
<?php
require_once('./global.php');
gzip();
dbconn();
loggedinorreturn();
maxsysop();
parked(); 

?>
<base target="_blank">
<body bgcolor="#000000">
<p>
<p align="center"><a href="/games.php"><img alt="Games"  title="Games" width=50 hight=50 border="0" src="/pic/games.gif">......<a href="/casino.php"><img alt="Casino"  title="Casino" width=50 hight=50 border="0" src="/pic/casino.gif">......<a href="/blackjack.php"><img alt="BlackJack"  title="BlackJack" width=50 hight=50 border="0" src="/pic/blackjack.jpg">

<?
Fix for TS 5.6:
create user casinobot make it whatever group you like and around line 352 of casino.php

Find:
Code:
VALUES (".sqlesc('casinobOT').", ".sqlesc('999999999').", ".sqlesc('<span style="color: #FF8040;"><strong><em>{username}</em></strong></span>').", '".TIMENOW."', ".sqlesc($casinobOT).")" or sqlerr(__FILE__, __LINE__);
edit the 999999999 and put id of casinobot and it should work.


Attached Files
File Type: rar ts_se_5.x_blackjack_casino.rar (201.7 KB, 375 views)
Reply With Quote
The Following User Says Thank You to Krypto For This Useful Post:
Protheush (14th April 2014)