So i made a Carnival to give members something to do over the weekend and i thought i'd share it with you guys its really cheezy but still something to add and work with:
first open phpmyadmin and run this query
alter table users add `tickets` int(11) NOT NULL default '0';
then create carnival.php
<?php
/*-----------------------------------------------------
carnival
Free to use if you like
-----------------------------------------------------*/
session_start();
require "global_func.php";
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
if($ir['jail']>0 || $ir['hospital']>0)
die("You can not move around right now.");
if(!$_GET['buy'])
{
print "Welcome to the Carnival. You currently have {$ir['tickets']} tickets do you want to buy some?";
print "What would you like to do?
[url='carnival.php?buy=ticket']Buy Tickets - $5000 for 5 tickets[/url]
[url='carnigames.php?action=balloon'] Balloon Dart Game - 5 Tickets per dart.[/url]
[url='carnigames.php?action=duck']Lucky Ducks - 5 Tickets per duck[/url]
[url='carnigames.php?action=strongman']Strongman Game - 5 Tickets per swing[/url]
[url='carnigames.php?action=dunk']Dunking Booth - 5 Tickets per throw[/url]
";
}
else
{
if($_GET['buy'] == 'ticket')
{
if($ir['money'] <5000)
{
print "You don't have enough money for tickets";
}
else
{
mysql_query("UPDATE users SET money=money-5000,tickets=tickets+5 WHERE userid=$userid",$c);
print "You have paid $5000 for 5 carnival tickets.";
}
}
}
?>
Then create carnigames.php
<?php
/*-----------------------------------------------------
Free to use if you like
-----------------------------------------------------*/
session_start();
require "global_func.php";
$userid=$_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE
u.userid=$userid",$c) or die(mysql_error());
$ir=mysql_fetch_array($is);
check_level();
$fm=money_formatter($ir['money']);
$cm=money_formatter($ir['crystals'],'');
$lv=date('F j, Y, g:i a',$ir['laston']);
$h->userdata($ir,$lv,$fm,$cm);
$h->menuarea();
if($ir['tickets']<1)
die("You are out of tickets. [url='carnival.php']Go buy some[/url]");
if ($_GET['action'] == 'balloon') {
$bal=rand(1,100);
if ($bal>=10) {
print "You missed!
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
else {
print "You pop a balloon and win 5 Crystals!
";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
mysql_query("update users set crystals=crystals+5 where userid=$userid",$c);
}
}
if ($_GET['action'] == 'duck') {
$dck=rand(1,10);
if ($dck==1) {
print "You picked up the duck with the number 1 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==2) {
print "You picked up the duck with the number 2 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==3) {
print "You picked up the duck with the number 3 on the bottom! You won 3 Crystals!
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
mysql_query("update users set crystals=crystals+3 where userid=$userid",$c);
}
if ($dck==4) {
print "You picked up the duck with the number 4 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==5) {
print "You picked up the duck with the number 5 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==6) {
print "You picked up the duck with the number 6 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==7) {
print "You picked up the duck with the number 7 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==8) {
print "You picked up the duck with the number 8 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==9) {
print "You picked up the duck with the number 9 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($dck==10) {
print "You picked up the duck with the number 10 on the bottom! Sorry the lucky number was 3
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
}
if ($_GET['action'] == 'strongman') {
$mrk=rand(1,10);
if ($mrk==1) {
print "You pick up the hammer and swing! The little marker barely moves...pityful
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==2) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says
...weakling
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==3) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says
...wimpy
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==4) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...give it
up
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==5) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...only
halfway how sad
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==6) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...getting
there
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==7) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...almost
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==8) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...Good
Girl
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==9) {
print "You pick up the hammer and swing! The marker moves up a little to the spot that says ...Good
boy
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($mrk==10) {
print "You pick up the hammer and swing! You hear the bell ring!!! You won 2 Demon Claws
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
mysql_query("update users set crystals=crystals+2 where userid=$userid",$c);
}
}
if ($_GET['action'] == 'dunk') {
print"staffmember is currently in the Dunking Booth
";
$bal=rand(1,10);
if ($bal==1) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==2) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==3) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==4) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==5) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==6) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==7) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==8) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==9) {
print "You throw the ball and miss so staffmember taunts you
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
}
if ($bal==10) {
print "You throw the ball and hit the target and staffmember goes for a dip!!! You won 5 crystals
[url='carnival.php']Back[/url]";
mysql_query("update users set tickets=tickets-5 where userid=$userid",$c);
mysql_query("update users set crystals=crystals+5 where userid=$userid",$c);
}
}
?>
You can edit the prizes and the cost of the tickets as you see fit and in the dunking booth you will need to change everywhere it says staffmember to the name of one of your staff members and you should be all set. :mrgreen: