Jump to content
MakeWebGames

g-unit

Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by g-unit

  1. Re: Supporter Days{v1} i just converted it v2   smarket.php     <?php // Supporter Days Market // Originally DDay Market // Editted and released by Liam include "globals.php"; switch($_GET['action']) { case "buy": sdays_buy(); break; case "remove": sdays_remove(); break; case "add": sdays_add(); break; default: sdays_index(); break; } function sdays_index() { global $ir,$c,$userid,$h; print "[Add A Listing]   <table width=100%> <tr> <th>Adder</th> <th>Qty</th> <th>Price each</th> <th>Price total</th> <th>Links</th> </tr>"; $q=mysql_query("SELECT sd.*, u.* FROM sdaysmarket sd LEFT JOIN users u ON u.userid=sd.sdADDER ORDER BY sdPRICE/sdQTY ASC",$c); while($r=mysql_fetch_array($q)) { if($r['sdADDER'] == $userid) { $link = "Remove"; } else { $link = "Buy"; } $each= (int) $r['sdPRICE'] / $r['sdQTY']; echo "<tr> <td>{$r['username']} [{$r['userid']}]</td> <td>{$r['sdQTY']}</td> <td> \$" . number_format($each)."</td> <td>\$".number_format($r['sdPRICE'])."</td> <td>[$link]</td> </tr>"; } echo "</table>"; } function sdays_remove() { global $ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM sdaysmarket WHERE sdID={$_GET['ID']} AND sdADDER=$userid",$c); if(!mysql_num_rows($q)) { echo "Error, either these Supporter Market Days do not exist, or you are not the owner. > Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); mysql_query("UPDATE users SET supporterdays=supporterdays+{$r['ddQTY']} where userid=$userid",$c) or die(mysql_error()); _query("DELETE FROM sdaysmarket WHERE sdID={$_GET['ID']}",$c); echo "Supporter Days removed from market! mysql > Back"; } function sdays_buy() { global $ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM sdaysmarket sd WHERE sdID={$_GET['ID']}",$c); if(!mysql_num_rows($q)) { echo "Error, either these Supporter Days do not exist, or they have already been bought. > Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); if($r['sdPRICE'] > $ir['money']) { echo "Error, you do not have the funds to buy these Supporter Days. > Back"; $h->endpage(); exit; } mysql_query("UPDATE users SET supporterdays=supporterdays+{$r['sdQTY']} where userid=$userid",$c) or die(mysql_error()); mysql_query("DELETE FROM sdaysmarket WHERE sdID={$_GET['ID']}",$c); mysql_query("UPDATE users SET money=money-{$r['sdPRICE']} where userid=$userid",$c); mysql_query("UPDATE users SET money=money+{$r['sdPRICE']} where userid={$r['sdADDER']}",$c); event_add($r['sdADDER'],"{$ir['username']} bought your {$r['sdQTY']} Supporter Days from the market for \$".number_format($r['sdPRICE']).".",$c); print "You bought the {$r['sdQTY']} Supporter Days from the market for \$".number_format($r['sdPRICE']).".   Back"; } function sdays_add() { global $ir,$c,$userid,$h; $_POST['amnt'] = abs((int) $_POST['amnt']); $_POST['price'] = abs((int) $_POST['price']); if($_POST['amnt']) { if($_POST['amnt'] > $ir['supporterdays']) { die ("You are trying to add more Supporter Days to the market than you have."); } $tp=$_POST['amnt']*$_POST['price']; mysql_query("INSERT INTO sdaysmarket VALUES('',{$_POST['amnt']},$userid,$tp)", $c); mysql_query("UPDATE users SET supporterdays=supporterdays-{$_POST['amnt']} WHERE userid=$userid", $c); echo "supporter days added to market! > Back"; } else { echo "Adding a listing...   You have {$ir['supporterdays']} Suporter Days that you can add to the market. <form action='smarket.php?action=add' method='post'> <table width=50% border=2> <tr> <td>Supporter Days:</td> <td><input type='text' name='amnt' value='{$ir['supporterdays']}' /></td> </tr> <tr> <td>Price Each:</td> <td><input type='text' name='price' value='2000' /></td> </tr> <tr> <td colspan=2 align=center> <input type='submit' value='Add To Market' /> </tr> </table> </form>"; } } $h->endpage(); ?>
  2. Re: [mccode] Poker Script for v1 this is the v2 mod i just converted if its worng mail me <?php /*----------------------------------------------------- An Established Modification Given Free by oxidati0n at CE! Why don't you join the biggest online RPG gaming community with replies of your topic within 5 minutes? Well Then Visit http://www.criminalexistence.com/forum/ ... gnup;begin It's fast, safe and free! - No private details are required -----------------------------------------------------*/ include "globals.php"; print "<h3>Poker</h3>"; //-Configuration $ChipPrice=500; // Price Per Chip in Poker $times=350; //-- how many rounds the poker game should last if(!$_SESSION['chips']) { $chiptxt="no"; } else {$chiptext=$_SESSION['chips']; } if(!$_GET['action']) { if($_SESSION['game'] == 1) { die("You cannot visit here while in a game!"); } print "Welcome to the All-Stars Poker Room! This Place is either where you have your day or you don't! Warning: If you enter the game and decide to quit before finished, You lose all your chips You currently have $_SESSION[chips] chips! <table width=50% border=1 style=\"border:groove;\" bordercolor=orange> <tr><td> Buy Chips</td></tr> <tr><td>Back to Game</td></tr>"; if($_SESSION['chips'] > 0) { print "<tr><td> Start Your Game</td></tr><tr><td> Sell Chips</td></tr>"; } print "</table>"; } else if($_GET['action'] == "game" and $_SESSION['game'] == 1) { if($_SESSION['times'] == 0) { print "You have used up all your turns and have finished your Poker game! Click here to visit home and use up all your chips on whatever you want "; $_SESSION['game']=0; $h->endpage(); exit(); } if($_SESSION['chips'] < 0) { print "You have used up all your chips and your broke! You were sent out of the poker room! Back "; $_SESSION['chips']=0; $_SESSION['game']=0; $h->endpage(); exit(); } print " "; if($_POST['chips_use'] < $_SESSION['chips'] and $_POST['chips_use'] > 0 and $_POST['chips_use']) { $chances=rand(150,750); if($chances > 450) { $used=$_POST['chips_use']*2; print "I'm sorry you lost $used chips! <hr />"; $_SESSION['chips']=$_SESSION['chips']-$used; } else { $won=$_POST['chips_use']*5; print "Congrats, You won and were credited $used chips! <hr />"; $_SESSION['chips']=$_SESSION['chips']+$won; } } else if(isset($_GET['gambleall'])) { $chipam=(int) rand(1,$_SESSION['chips']); $chances=rand(150,750); if($chances > 350) { $used=$chipam*2; print "I'm sorry you lost $used chips! <hr />"; $_SESSION['chips']=$_SESSION['chips']-$used; } else { $won=$chipam*5; print "Congrats, You won and were credited $used chips! <hr />"; $_SESSION['chips']=$_SESSION['chips']+$won; } } print "What do you want to do You have <font color=orange>$_SESSION[chips]</font> chips left You have <font color=green>\$".number_format($ir['money'])."</font> money left You have <font color=teal>\$".number_format($_SESSION['chips']*$ChipPrice)."</font> money from chips <table width=50% border=1><tr><td>Use My Turn <form action='poker.php?action=game' method='post'>Chips to Use :<input type='text' name='chips_use' value='$_SESSION[chips]'> <input type=submit value='-Take My Turn-'></form> </td></tr></table> Gamble Random Quit Game "; $_SESSION['game']=1; } else if($_GET['action'] == "gamequit" and $_SESSION['game'] == 1) { if($_GET['next'] == "confirmed") { $_SESSION['times']=0; $_SESSION['game']=0; print "You have left the tournament! Back Quit now! No, stay in the poker room "; } } else if($_GET['action'] == "startgame") { if($_SESSION['game'] == 1) { print "You have already started the game Click here to go back to your table "; exit(); } if($_SESSION['chips'] == 0) { print "You have no chips, So you cannot enter! Back "; $h->endpage(); exit(); } print "You have started the game Click here to go to your table "; $_SESSION['game']=1; $_SESSION['times']=$times; } else if($_GET['action'] == "sellchips") { if($_SESSION['game'] == 1) { die("You cannot buy chips while you are in a game"); } if($_SESSION['chips'] == 0) { print "You don't have any chips to sell dude! Back "; } else if($_POST['chips'] > 0) { if($_POST['chips'] > $_SESSION['chips']) { print "I'm sorry you don't have that many chips in your command Back "; } else { $cashtopay=$_POST['chips']*$ChipPrice; mysql_query("UPDATE users SET money=money+$cashtopay WHERE userid=$userid"); $_SESSION['chips']=$_SESSION['chips']-$_POST['chips']; print "You have sold $_POST[chips] chip's and you have been paid \$$cashtopay! Back "; } } else { if($_POST['chips'] < 0) { if($_SESSION['abused'] == "ONCEA") { print "<font color=red>Thats it you've cheated twice, I'll just put you in hospital for 50 minutes and you get can lost cause i get all your chips, Your toasted fool!</font> "; mysql_query("UPDATE users SET hospital=50, hospreason='Tryed to Cheat at the Poker House' WHERE userid=$userid"); $_SESSION['chips']=0; $_SESSION['abused']=0; $h->endpage(); exit(); } print "<font color=red>Thats it, Cheat One more time and your toasted!</font> "; $_SESSION['abused']="ONCEA"; $h->endpage(); exit(); } print "You currently have $_SESSION[chips] You can sell <form action='poker.php?action=sellchips' method='post'> <table width=90% border=1><tr><th>Chips</th><td><input type='text' name='chips' value='$_SESSION[chips]'></td></tr> <tr><th>PPC (Price Per Chip)</th><td>\$".number_format($ChipPrice)."</td></tr> <tr><td colspan=2><input type=submit value='Sell Chips'></td></tr> </table></form>"; } } else if($_GET['action'] == "buychips") { if($_SESSION['game'] == 1) { die("You cannot buy chips while you are in a game"); } if($_POST['chips']> 0) { $POKER['chipprice']=$_POST['chips']*$ChipPrice; if($_POST['chipprice'] > $_POST['money']) { print "I'm sorry you don't have enough money to buy $_POST[chips] chips Back "; } else { $new['chips']=$_SESSION['chips']+$_POST['chips']; $_SESSION['chips']=$new['chips']; mysql_query("UPDATE users SET money=money-$POKER[chipprice] WHERE userid=$userid"); print "You bought <font color=orange>$_POST[chips]</font> chips for <font color=green>\$".number_format($POKER[chipprice])."</font>! You must not logout or you will lose all your chips, These chips are only allowed now during your session. Back "; } } else { if($_POST['chips'] < 0) { if($_SESSION['abused'] == "ONCE") { print "<font color=red>Thats it you've cheated twice, I'll just put you in hospital for 50 minutes and you get can lost cause i get all your chips, Your toasted fool!</font> "; mysql_query("UPDATE users SET hospital=50, hospreason='Tryed to Cheat at the Poker House' WHERE userid=$userid"); $_SESSION['chips']=0; $_SESSION['abused']=0; $h->endpage(); exit(); } print "<font color=red>Thats it, Cheat One more time and your toasted!</font> "; $_SESSION['abused']="ONCE"; $h->endpage(); exit(); } print "Buy Chips <form action='poker.php?action=buychips' method='post' name='buychips'> <table width=50% border=1><tr><th>Chips</th><td> <input type='text' name='chips' size=6 maxlength=4></td></tr> <tr><td colspan=2> </td></tr> <tr><th>PPC (Price Per Chip)</th><td>\$".number_format($ChipPrice)."</td></tr> <tr><td colspan=2><input type=submit value='-Purchase Chips-'></td></tr> </table></form>"; } } else { print "ERROR! You have selected an invalid function, Please check back or Go through the side menu Back "; } $h->endpage(); ?>
×
×
  • Create New...