Jump to content
MakeWebGames

[mccode] crystal slots


-Genocide-

Recommended Posts

updated 2/27/2007

crystalslots.php

<?php

/*--------------------------------------

MCCodes Lite

original slotsmachine.php Rev 1.0.0

Copyright © 2006 Dabomstew

This program is free software; you can redistribute it and/or

modify it under the terms of the GNU General Public License

as published by the Free Software Foundation; either version 2

of the License, or (at your option) any later version.

Updated By: spellbyte

Fixed By: Genocide

http://notoriousonline.net

This mod is distributed without warranty!

---------------------------------------*/

session_start();

require "global_func.php";

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

$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);

$h->menuarea();

$tresder = (int) (rand(100,999));

$maxbet=$ir['level']*250;

$_GET['tresde']=abs((int) $_GET['tresde']);

if(($_SESSION['tresde'] == $_GET['tresde']) || $_GET['tresde']<100)

{

die ("Error, you cannot refresh or go back on the slots, please use a side link to go somewhere else.

> Back");

}

$_SESSION['tresde']=$_GET['tresde'];

$_GET['bet']=abs((int) $_GET['bet']);

print "

Crystal Slots

";

if($_GET['bet'])

{

if($_GET['bet'] > $ir['crystals'])

{

die("You are trying to bet more than you have.

> Back");

}

else if($_GET['bet'] > $maxbet)

{

die("You have gone over the max bet.

> Back");

}

$slot[1]=(int) rand(0,9);

$slot[2]=(int) rand(0,9);

$slot[3]=(int) rand(0,9);

print "You place {$_GET['bet']} gems into the slot and pull the handle.

You see the numbers: $slot[1] $slot[2] $slot[3]

You bet {$_GET['bet']} gems ";

if($slot[1]==$slot[2] && $slot[2]==$slot[3])

{

$won=$_GET['bet']*26;

$gain=$_GET['bet']*25;

print "and won $won gems by lining up 3 numbers pocketing you $gain extra.";

}

else if ($slot[1]==$slot[2] || $slot[2]==$slot[3] || $slot[1]==$slot[3])

{

$won=$_GET['bet']*3;

$gain=$_GET['bet']*2;

print "and won $won gems by lining up 2 numbers pocketing you $gain extra.";

}

else

{

$won=0;

$gain=-$_GET['bet'];

print "and lost it.";

}

mysql_query("UPDATE users SET crystals=crystals+({$gain}) where userid=$userid", $c);

$tresder = (int) (rand(100,999));

print "

> Another time, same bet.

> I'll continue, but I'm changing my bet.

> Enough's enough, I'm off.";

}

else

{

print "Ready to try your luck? Play today!

The maximum bet for your level is $maxbet.

 

Bet:

 

 

";

}

$h->endpage();

?>

Link to comment
Share on other sites

  • 5 months later...
  • 6 months later...
  • 1 month later...
Guest Anonymous

Re: [mccode] crystal slots

It,s simply getting....

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And replacing it with

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and mysql_ to $db-> well i don,t think u even have to do that this is most mods any way

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...