Jump to content
MakeWebGames

sixsens

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by sixsens

  1. im tring to make my inventory look like that.. i have to many item and its take on my nerve to scroll down for a minute.. ill try to do it. Any help would pe please..
  2. Great mod.. Thanks for this free mod. cool! +1
  3. im close to make it all work.. my only problem is when i equip and there is already something equip..
  4. here an equip page its working great. but if there is already something equip it doesnt take out the stat of the already equiped item that is about to be replace. im trying to figure what i should do. add another edition where i take out the effect of the already equipped tiem or if there is something already equipped die endpage "unequip before equip a new item" something like that. if anyone can help me with this little situation. ;) <?php include "globals.php"; $_GET['ID'] = abs((int) $_GET['ID']); $id=$db->query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1"); if($db->num_rows($id)==0) { print "Invalid item ID"; $h->endpage(); exit; } else { $r=$db->fetch_row($id); } if(!$r['amulet']) { print "This item cannot be equipped to this slot."; $h->endpage(); exit; } if($_GET['type']) { if(!in_array($_GET['type'], array("equip_amulet"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if($r['effect1_on']) { $einfo=unserialize($r['effect1']); if(in_array($einfo['stat'], array('strength', 'agility', 'guard', 'labour', 'IQ'))) { $stats=$einfo['stat']; $upd=$einfo['inc_amount']; $db->query("UPDATE `userstats` SET $stats=$stats+$upd WHERE userid=$userid"); } } if($ir[$_GET['type']]) { item_add($userid, $ir[$_GET['type']], 1); } item_remove($userid, $r['itmid'], 1); $db->query("UPDATE users SET {$_GET['type']} = {$r['itmid']} WHERE userid={$userid}"); print "Item {$r['itmname']} equipped successfully."; } else { print "<h3>Equip Amulet</h3><hr /> <form action='equip_amulet.php' method='get'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Click Equip Amulet to equip {$r['itmname']} as your amulet, if you currently have any amulets equipped it will be removed back to your inventory. <input type='hidden' name='type' value='equip_amulet' /> <input type='submit' value='Equip Amulet' /></form>"; } $h->endpage(); ?>
  5. this work now...!!!   <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']}, {$ir['equip_helmet']}, {$ir['equip_boots']}, {$ir['equip_amulet']}, {$ir['equip_braclet']}, {$ir['equip_ring']}, {$ir['equip_special']})"); $r=$db->fetch_row($q); if(!in_array($_GET['type'], array("equip_primary", "equip_secondary", "equip_armor", "equip_helmet", "equip_boots", "equip_amulet", "equip_braclet", "equip_ring", "equip_special"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if(!$ir[$_GET['type']]) { print "You do not have anything equipped in this slot."; $h->endpage(); exit; } item_add($userid, $ir[$_GET['type']], 1); $db->query("UPDATE users SET {$_GET['type']}=0 WHERE userid={$ir['userid']}"); $names=array( "equip_primary" => "Primary Weapon", "equip_secondary" => "Secondary Weapon", "equip_armor" => "Armor", "equip_helmet" => "Helmet", "equip_boots" => "Boots", "equip_amulet" => "Amulet", "equip_braclet" => "Braclet", "equip_ring" => "Ring", "equip_special" => "Special", ); print "The item in your {$names[$_GET['type']]} slot was successfully unequiped."; $get = $db->query("SELECT `effect2` FROM `items` WHERE (`effect2_on`=1) AND (`itmid`={$ir[$_GET['type']]})"); if( $db->num_rows($get) ) { $r = $db->fetch_row($get); $einfo=unserialize($r['effect2']); if(in_array($einfo['stat'], array('strength', 'agility', 'guard', 'labour', 'IQ'))) { $stats=$einfo['stat']; $upd=$einfo['inc_amount']; $db->query("UPDATE `userstats` SET $stats=$stats-$upd WHERE userid=$userid"); } } $h->endpage(); ?>   seem ok let me test it no error and the stat go down ;) octarine+sniko+lucky3809 did the hattrick let me know if anyone of you want the 10$ you will have to split in 3 or 2... as i said ill pay by paypal in a day or 2 gime mail for paiement. :) thx again.. ill still wait for the finish version of lucky3809 wanna see if he can make it better. good coding guys
  6. Your the man! let me know if you want me to test :)
  7. Fatal error: Call to undefined method database::fetch_array() in C:\wamp\www\unequip.php on line 34 this is the error i get with your edit SNIKO   <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']}, {$ir['equip_helmet']}, {$ir['equip_boots']}, {$ir['equip_amulet']}, {$ir['equip_braclet']}, {$ir['equip_ring']}, {$ir['equip_special']})"); $r=$db->fetch_row($q); if(!in_array($_GET['type'], array("equip_primary", "equip_secondary", "equip_armor", "equip_helmet", "equip_boots", "equip_amulet", "equip_braclet", "equip_ring", "equip_special"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if(!$ir[$_GET['type']]) { print "You do not have anything equipped in this slot."; $h->endpage(); exit; } item_add($userid, $ir[$_GET['type']], 1); $db->query("UPDATE users SET {$_GET['type']}=0 WHERE userid={$ir['userid']}"); $names=array( "equip_primary" => "Primary Weapon", "equip_secondary" => "Secondary Weapon", "equip_armor" => "Armor", "equip_helmet" => "Helmet", "equip_boots" => "Boots", "equip_amulet" => "Amulet", "equip_braclet" => "Braclet", "equip_ring" => "Ring", "equip_special" => "Special", ); print "The item in your {$names[$_GET['type']]} slot was successfully unequiped."; $get = $db->query("SELECT `effect2` FROM `items` WHERE (`effect2_on`=1) AND (`itmid`={$ir[$_GET['type']]})"); if( $db->num_rows($get) ) { $r = $db->fetch_array($get); $einfo=unserialize($r['effect2']); if(in_array($einfo['stat'], array('strength', 'agility', 'guard', 'labour', 'IQ'))) { $stats=$einfo['stat']; $upd=$einfo['inc_amount']; $db->query("UPDATE `userstats` SET $stats=$stats-$upd WHERE userid=$userid"); } } $h->endpage(); ?>
  8. thanks SNIKO i have test but nothing. Thanks Lucky3809 too, ill try to fix but as im new it could be long. thx for taking time for me guys. the idea is so cool that i cant delete it. :) if anyone have an idea how to fix this ill still pay 10$
  9. ill pay 10$ if anyone found a solution for the unequip effect
  10. 1st i love this mod. +1 equip part, work great but it double the ammount we set in effect. unequip part, doesnt work at all (nothing hapen). i tried many way and nothing come up! here is my unequip.php before making any change.. (where should i edit please) <?php include "globals.php"; if(!in_array($_GET['type'], array("equip_primary", "equip_secondary", "equip_armor", "equip_helmet", "equip_boots", "equip_amulet", "equip_braclet", "equip_ring", "equip_special"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if(!$ir[$_GET['type']]) { print "You do not have anything equipped in this slot."; $h->endpage(); exit; } item_add($userid, $ir[$_GET['type']], 1); $db->query("UPDATE users SET {$_GET['type']}=0 WHERE userid={$ir['userid']}"); $names=array( "equip_primary" => "Primary Weapon", "equip_secondary" => "Secondary Weapon", "equip_armor" => "Armor", "equip_helmet" => "Helmet", "equip_boots" => "Boots", "equip_amulet" => "Amulet", "equip_braclet" => "Braclet", "equip_ring" => "Ring", "equip_special" => "Special", ); print "The item in your {$names[$_GET['type']]} slot was successfully unequiped."; $h->endpage(); ?>   here with edit   <?php include "globals.php"; $q=$db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']}, {$ir['equip_helmet']}, {$ir['equip_boots']}, {$ir['equip_amulet']}, {$ir['equip_braclet']}, {$ir['equip_ring']}, {$ir['equip_special']})"); $r=$db->fetch_row($q); if(!in_array($_GET['type'], array("equip_primary", "equip_secondary", "equip_armor", "equip_helmet", "equip_boots", "equip_amulet", "equip_braclet", "equip_ring", "equip_special"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if(!$ir[$_GET['type']]) { print "You do not have anything equipped in this slot."; $h->endpage(); exit; } item_add($userid, $ir[$_GET['type']], 1); if($r['effect2_on']) { $einfo=unserialize($r['effect2']); if(in_array($einfo['stat'], array('strength', 'agility', 'guard', 'labour', 'IQ'))) { $stats=$einfo['stat']; $upd=$einfo['inc_amount']; $db->query("UPDATE `userstats` SET $stats=$stats-$upd WHERE userid=$userid"); } } $db->query("UPDATE users SET {$_GET['type']}=0 WHERE userid={$ir['userid']}"); $names=array( "equip_primary" => "Primary Weapon", "equip_secondary" => "Secondary Weapon", "equip_armor" => "Armor", "equip_helmet" => "Helmet", "equip_boots" => "Boots", "equip_amulet" => "Amulet", "equip_braclet" => "Braclet", "equip_ring" => "Ring", "equip_special" => "Special", ); print "The item in your {$names[$_GET['type']]} slot was successfully unequiped."; $h->endpage(); ?>
  11. im talking about the delusercar function that is missing. thx ruler...
  12. Here a poker script that im tring to fit the mccode v2 ill post update soon as i fix the money merge with the game.:confused: any help would be appreciate.   <?php include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } if(!$_GET['spend']) ?> <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'>Video Poker</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> <table class='tablee'><center><img src='/images/videopoker.png' /></table><br> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 //EN"> <html> <style> body { margin: 0; padding: 0; font-family: Arial; font-size: 12px; color: #FFFFFF; background: #000000; } .div-game { margin: 3% auto; width: 440px; color: #FFFFFF; background: #4F4F4F; border-right: 1px solid #7F7F7F; border-top: 1px solid #7F7F7F; } .div-pay { position: relative; margin: 10px; padding: 10px; font-weight: bold; color: #AFAFAF; background: #000000; border-left: 2px solid #7F7F7F; border-bottom: 2px solid #7F7F7F; } .table-pay { margin: auto; } .table-pay td { border: 1px solid #5F0000; } .div-pay-hand { width: 150px; font-family: Verdana; font-size: 12px; text-align: left; } .div-pay-money { width: 45px; font-family: Courier; font-size: 12px; text-align: right; } .div-board { position: relative; margin: 5px 10px; padding: 5px 10px; color: #FFFFFF; background: #666666; border-left: 2px solid #7F7F7F; border-bottom: 2px solid #7F7F7F; } .table-score { margin: auto; } .div-credit, .credit, .div-bet, .bet { font-family: Verdana; font-size: 16px; font-weight: bold; } .div-credit { width: 60px; text-align: right; color: #00AF00; background: transparent; } .credit { width: 150px; padding-left: 5px; color: #00FF00; background: transparent; } .div-bet { width: 155px; text-align: right; color: #AF0000; background: transparent; } .bet { width: 15px; padding-left: 5px; color: #FF0000; background: transparent; } .table-cards { margin: auto; } .img-card { overflow: hidden; margin: 15px 5px 10px; } .div-message { height: 15px; font-family: Verdana; font-size: 12px; font-weight: bold; text-align: center; color: #CFCF00; background: transparent; } .div-button { position: relative; margin: 5px; padding: 10px; text-align: center; } .bn { width: 100px; } .span-preload { display: none; } </style> <body onload="game.run();"> <div id="div-game" class="div-game"> <div id="div-pay" class="div-pay"> <table id="table-pay" class="table-pay" cellspacing="0" cellpadding="0"> <tr> <td><div id="rf" class="div-pay-hand">Royal Flush</div></td> <td><div id="rf-1" class="div-pay-money">250</div></td> <td><div id="rf-2" class="div-pay-money">500</div></td> <td><div id="rf-3" class="div-pay-money">750</div></td> <td><div id="rf-4" class="div-pay-money">1000</div></td> <td><div id="rf-5" class="div-pay-money">5000</div></td> </tr> <tr> <td><div id="sf" class="div-pay-hand">Straight Flush</div></td> <td><div id="sf-1" class="div-pay-money">50</div></td> <td><div id="sf-2" class="div-pay-money">100</div></td> <td><div id="sf-3" class="div-pay-money">150</div></td> <td><div id="sf-4" class="div-pay-money">200</div></td> <td><div id="sf-5" class="div-pay-money">250</div></td> </tr> <tr> <td><div id="fk" class="div-pay-hand">Four of a Kind</div></td> <td><div id="fk-1" class="div-pay-money">25</div></td> <td><div id="fk-2" class="div-pay-money">50</div></td> <td><div id="fk-3" class="div-pay-money">75</div></td> <td><div id="fk-4" class="div-pay-money">100</div></td> <td><div id="fk-5" class="div-pay-money">125</div></td> </tr> <tr> <td><div id="fh" class="div-pay-hand">Full House</div></td> <td><div id="fh-1" class="div-pay-money">9</div></td> <td><div id="fh-2" class="div-pay-money">18</div></td> <td><div id="fh-3" class="div-pay-money">27</div></td> <td><div id="fh-4" class="div-pay-money">36</div></td> <td><div id="fh-5" class="div-pay-money">45</div></td> </tr> <tr> <td><div id="fl" class="div-pay-hand">Flush</div></td> <td><div id="fl-1" class="div-pay-money">6</div></td> <td><div id="fl-2" class="div-pay-money">12</div></td> <td><div id="fl-3" class="div-pay-money">18</div></td> <td><div id="fl-4" class="div-pay-money">24</div></td> <td><div id="fl-5" class="div-pay-money">30</div></td> </tr> <tr> <td><div id="st" class="div-pay-hand">Straight</div></td> <td><div id="st-1" class="div-pay-money">4</div></td> <td><div id="st-2" class="div-pay-money">8</div></td> <td><div id="st-3" class="div-pay-money">12</div></td> <td><div id="st-4" class="div-pay-money">16</div></td> <td><div id="st-5" class="div-pay-money">20</div></td> </tr> <tr> <td><div id="tk" class="div-pay-hand">Three of a Kind</div></td> <td><div id="tk-1" class="div-pay-money">3</div></td> <td><div id="tk-2" class="div-pay-money">6</div></td> <td><div id="tk-3" class="div-pay-money">9</div></td> <td><div id="tk-4" class="div-pay-money">12</div></td> <td><div id="tk-5" class="div-pay-money">15</div></td> </tr> <tr> <td><div id="tp" class="div-pay-hand">Two Pair</div></td> <td><div id="tp-1" class="div-pay-money">2</div></td> <td><div id="tp-2" class="div-pay-money">4</div></td> <td><div id="tp-3" class="div-pay-money">6</div></td> <td><div id="tp-4" class="div-pay-money">8</div></td> <td><div id="tp-5" class="div-pay-money">10</div></td> </tr> <tr> <td><div id="jb" class="div-pay-hand">Jacks or Better</div></td> <td><div id="jb-1" class="div-pay-money">1</div></td> <td><div id="jb-2" class="div-pay-money">2</div></td> <td><div id="jb-3" class="div-pay-money">3</div></td> <td><div id="jb-4" class="div-pay-money">4</div></td> <td><div id="jb-5" class="div-pay-money">5</div></td> </tr> </table> </div> <div id="div-board" class="div-board"> <table id="table-score" class="table-score" cellspacing="0" cellpadding="0"> <tr> <td><div id="div-credit" class="div-credit">Credit:</div></td> <td><div id="credit" class="credit"></div></td> <td><div id="div-bet" class="div-bet">Bet:</div></td> <td><div id="bet" class="bet"></div></td> </tr> </table> <table id="table-cards" class="table-cards" cellspacing="0" cellpadding="0"> <tr> <td><img id="card0" class="img-card" src="videopoker/reverse.png" onclick="game.onDiscard(0);" /></td> <td><img id="card1" class="img-card" src="videopoker/reverse.png" onclick="game.onDiscard(1);" /></td> <td><img id="card2" class="img-card" src="videopoker/reverse.png" onclick="game.onDiscard(2);" /></td> <td><img id="card3" class="img-card" src="videopoker/reverse.png" onclick="game.onDiscard(3);" /></td> <td><img id="card4" class="img-card" src="videopoker/reverse.png" onclick="game.onDiscard(4);" /></td> </tr> </table> <div id="div-message" class="div-message">Loading...</div> </div> <div id="div-button" class="div-button"> <input id="bn-max" type="button" class="bn" value="Bet Max" onclick="game.onBetMax();" name="bn-max" disabled/> <input id="bn-deal" type="button" class="bn" value="Deal" onclick="game.onDeal();" name="bn-deal" disabled/> <input id="bn-one" type="button" class="bn" value="Bet One" onclick="game.onBetOne();" name="bn-one" disabled/> </div> </div> <span id="span-preload" class="span-preload"> <img id="img0" src="videopoker/card0.png" /> <img id="img1" src="videopoker/card1.png" /> <img id="img2" src="videopoker/card2.png" /> <img id="img3" src="videopoker/card3.png" /> <img id="img4" src="videopoker/card4.png" /> <img id="img5" src="videopoker/card5.png" /> <img id="img6" src="videopoker/card6.png" /> <img id="img7" src="videopoker/card7.png" /> <img id="img8" src="videopoker/card8.png" /> <img id="img9" src="videopoker/card9.png" /> <img id="img10" src="videopoker/card10.png" /> <img id="img11" src="videopoker/card11.png" /> <img id="img12" src="videopoker/card12.png" /> <img id="img13" src="videopoker/card13.png" /> <img id="img14" src="videopoker/card14.png" /> <img id="img15" src="videopoker/card15.png" /> <img id="img16" src="videopoker/card16.png" /> <img id="img17" src="videopoker/card17.png" /> <img id="img18" src="videopoker/card18.png" /> <img id="img19" src="videopoker/card19.png" /> <img id="img20" src="videopoker/card20.png" /> <img id="img21" src="videopoker/card21.png" /> <img id="img22" src="videopoker/card22.png" /> <img id="img23" src="videopoker/card23.png" /> <img id="img24" src="videopoker/card24.png" /> <img id="img25" src="videopoker/card25.png" /> <img id="img26" src="videopoker/card26.png" /> <img id="img27" src="videopoker/card27.png" /> <img id="img28" src="videopoker/card28.png" /> <img id="img29" src="videopoker/card29.png" /> <img id="img30" src="videopoker/card30.png" /> <img id="img31" src="videopoker/card31.png" /> <img id="img32" src="videopoker/card32.png" /> <img id="img33" src="videopoker/card33.png" /> <img id="img34" src="videopoker/card34.png" /> <img id="img35" src="videopoker/card35.png" /> <img id="img36" src="videopoker/card36.png" /> <img id="img37" src="videopoker/card37.png" /> <img id="img38" src="videopoker/card38.png" /> <img id="img39" src="videopoker/card39.png" /> <img id="img40" src="videopoker/card40.png" /> <img id="img41" src="videopoker/card41.png" /> <img id="img42" src="videopoker/card42.png" /> <img id="img43" src="videopoker/card43.png" /> <img id="img44" src="videopoker/card44.png" /> <img id="img45" src="videopoker/card45.png" /> <img id="img46" src="videopoker/card46.png" /> <img id="img47" src="videopoker/card47.png" /> <img id="img48" src="videopoker/card48.png" /> <img id="img49" src="videopoker/card49.png" /> <img id="img50" src="videopoker/card50.png" /> <img id="img51" src="videopoker/card51.png" /> </span> <script type="text/javascript"> // // Game // function Game() { var self = this; this.player = new Player(100); this.croupier = new Croupier(); this.board = new Board(); this.ruler = new Ruler(); this.round = 1; this.cards = self.croupier.popCards(5); this.run = function() { self.start(); } this.start = function() { self.discardAll(); self.board.showCredit(self.player.credit); self.board.showBet(); self.board.showCards(self.cards); self.board.enableBet(true); } this.bet = function(bet) { if (0 == self.board.bet) self.discardAll(); if ( self.player.canBet(bet) ) if ( self.board.canBet(bet) ) self.doBet(bet); } this.doBet = function(bet) { self.player.doBet(bet); self.board.showCredit(self.player.credit); self.board.doBet(bet); self.board.showBet(); self.board.showPay(); self.board.enableDeal(true); } this.deal = function() { if (1 == self.round) self.firstRound() else self.secondRound(); } this.firstRound = function() { self.board.enableBet(false); self.croupier.shuffle(); self.popFirstHand(); self.round = 2; self.board.showMessage("Discard"); } this.secondRound = function() { self.board.showMessage(""); self.popSecondHand(); var hand = self.ruler.getHand(self.cards); self.pay(hand); self.board.unBet(); self.board.showBet(); self.board.showPay(); self.prize(hand); self.round = 1; self.board.enableDeal(false); self.board.enableBet(true); self.checkCredit(); } this.popFirstHand = function() { self.cards = self.croupier.popCards(5); self.board.showCards(self.cards); } this.popSecondHand = function() { for (var i in self.cards) if (self.cards[i].down) self.cards[i] = self.croupier.popCard(); self.board.showCards(self.cards); } this.discard = function(position) { if (2 == self.round) { self.cards[position].flip(); self.board.showCard(position, self.cards[position]); } } this.pay = function(hand) { if (hand){ self.player.pay( self.board.getPay(hand) ); self.board.showCredit(self.player.credit); } } this.prize = function(hand) { if (hand){ self.board.hilitePrize(hand); self.board.showMessage( self.board.getHand(hand) + "!"); } } this.checkCredit = function() { if (0 == self.player.credit){ alert("Your credit have been restored"); self.player.pay(100); self.board.showCredit(self.player.credit); } } this.discardAll = function() { self.board.unhilitePrize(); self.board.showPay(); self.discardCards(); self.board.showMessage(""); } this.discardCards = function() { for (var i in self.cards) self.cards[i].down = true; self.board.showCards(self.cards); } this.onBetOne = function() { self.bet(1); } this.onBetMax = function() { self.bet(self.board.maxBet - self.board.bet); } this.onDeal = function() { self.deal(); } this.onDiscard = function(card) { self.discard(card); } } // // Ruler // function Ruler() { var self = this; this.suits = new Array(4); this.numbers = new Array(13 + 1); this.getHand = function(cards) { self.countCards(cards); return( self.hand() ); } this.countCards = function(cards) { self.clear(); for (var i in cards) { ++ self.suits[cards[i].suit]; ++ self.numbers[cards[i].number - 1]; if (1 == cards[i].number) ++ self.numbers[self.numbers.length - 1]; } } this.clear = function() { for (var i = 0; i < self.suits.length; ++ i) self.suits[i] = 0; for (var i = 0; i < self.numbers.length; ++ i) self.numbers[i] = 0; } this.hand = function() { if ( self.royalFlush() ) return("rf"); if ( self.straightFlush() ) return("sf"); if ( self.fourOfAKind() ) return("fk"); if ( self.fullHouse() ) return("fh"); if ( self.flush() ) return("fl"); if ( self.straight() ) return("st"); if ( self.threeOfAKind() ) return("tk"); if ( self.twoPair() ) return("tp"); if ( self.jacksOrBetter() ) return("jb"); return(""); } this.royalFlush = function() { return( self.countSuits(5) && self.secuenceFrom(10, 5) ); } this.straightFlush = function() { return( self.countSuits(5) && self.secuence(5) ); } this.fourOfAKind = function() { return( self.countNumbers(4) ); } this.fullHouse = function() { return( self.countNumbers(2) && self.countNumbers(3) ); } this.flush = function() { return( self.countSuits(5) ); } this.straight = function() { return( self.secuence(5) ); } this.threeOfAKind = function() { return( self.countNumbers(3) ); } this.twoPair = function() { return( self.countNumbers(2) == 2 ); } this.jacksOrBetter = function() { return( self.countNumbersFrom(11, 2) ); } this.countSuits = function(group) { return( self.count(self.suits, 0, group) ); } this.countNumbers = function(group) { return( self.countNumbersFrom(2, group) ); } this.countNumbersFrom = function(number, group) { return( self.count(self.numbers, number - 1, group) ); } this.count = function(elements, offset, pattern) { var count = 0; for (var i = offset; i < elements.length; ++ i) if (elements[i] == pattern) ++ count; return(count); } this.secuence = function(group) { return( self.secuenceFrom(1, group) || self.secuenceFrom(2, group) ); } this.secuenceFrom = function(number, group) { var offset = number - 1; var start = self.secuenceStart(offset); var end = self.secuenceEnd(start + 1); return( (start >= offset) && ( (end - start + 1) == group ) ); } this.secuenceStart = function(offset) { for (var i = offset; i < self.numbers.length; ++ i) if (0 != self.numbers[i]) break; return(i); } this.secuenceEnd = function(offset) { for (var i = offset; i < self.numbers.length; ++ i) if (1 != self.numbers[i]) break; return(i - 1); } } // // Board // function Board() { var self = this; this.imgPath = "videopoker/"; this.hands = new Array("rf", "sf", "fk", "fh", "fl", "st", "tk", "tp", "jb"); this.maxBet = 5; this.bet = 0; this.prevBet = 0; this.canBet = function(bet) { return( (self.bet + bet) <= self.maxBet ); } this.doBet = function(bet) { self.prevBet = self.bet; self.bet += bet; } this.unBet = function(bet) { self.prevBet = self.bet; self.bet = 0; } this.getPay = function(hand) { return( Number( getHTMLElement( hand + "-" + String(self.bet) ).innerHTML ) ); } this.getHand = function(hand) { return( getHTMLElement(hand).innerHTML ); } this.showCredit = function(credit) { getHTMLElement("credit").innerHTML = String(credit); } this.showBet = function() { getHTMLElement("bet").innerHTML = String(self.bet); } this.showMessage = function(message) { getHTMLElement("div-message").innerHTML = message; } this.showCards = function(cards) { for (var i in cards) self.showCard(i, cards[i]); } this.showCard = function(position, card) { getHTMLElement( "card" + String(position) ).src = self.getCardImage(card); } this.getCardImage = function(card) { return( self.imgPath + ( card.down? "reverse": "card" + String(card.id) ) + ".png" ); } this.showPay = function() { for (var i in self.hands) { self.unhilitePay(self.hands[i], self.prevBet); self.hilitePay(self.hands[i], self.bet); } } this.unhilitePay = function(hand, bet) { self.setColorPay(hand, bet, "#AFAFAF"); } this.hilitePay = function(hand, bet) { self.setColorPay(hand, bet, "#CFCF00"); } this.setColorPay = function(hand, bet, color) { if (bet) getHTMLElement( hand + "-" + String(bet) ).style.color = color; } this.hilitePrize = function(hand) { self.setColorPrize(hand, "#FFFFFF"); self.setColorPay(hand, self.prevBet, "#FFFFFF"); } this.unhilitePrize = function() { for (var i in self.hands) self.setColorPrize(self.hands[i], "#AFAFAF"); } this.setColorPrize = function(hand, color) { getHTMLElement(hand).style.color = color; } this.enableDeal = function(state) { getHTMLElement("bn-deal").disabled = !state; } this.enableBet = function(state) { getHTMLElement("bn-one").disabled = !state; getHTMLElement("bn-max").disabled = !state; } } // // Croupier // function Croupier() { var self = this; this.deck = new Array(52); this.top = 0; this.shuffle = function() { for (var i in self.deck) self.swapCard(i, rand(self.deck.length) ); self.top = 0; } this.swapCard = function(i, j) { var tmp = self.deck[i]; self.deck[i] = self.deck[j]; self.deck[j] = tmp; } this.popCards = function(requested) { var cards = new Array(); for (var i = 0; i < requested; ++ i) cards[i] = self.popCard(); return(cards); } this.popCard = function() { return( new Card( self.deck[self.top ++] ) ); } //Create deck on constructor for (var i = 0; i < self.deck.length; ++ i) self.deck[i] = i; } // // Player // function Player(credit) { var self = this; this.credit = credit; this.canBet = function(bet) { return( self.credit >= bet ); } this.doBet = function(bet) { self.credit -= bet; } this.pay = function(pay) { self.credit += pay; } } // // Card // function Card(id) { var self = this; this.id = id; this.suit = Math.floor(self.id / 13); this.number = Math.floor(self.id % 13) + 1; this.down = false; this.flip = function() { self.down = !self.down; } } // // Utils // function rand(x) { return( Math.floor( Math.random() * x ) ); } function getHTMLElement(id) { return( document.getElementById(id) ); } // // Instance Game // var game = new Game() </script> </body> </html> </td></tr>
  13. i am tring to fix the delete user car action. as i see there is no function at all for it. as im new ill try to do it. any help will be pleased thx. here the code:   <?php include "sglobals.php"; if($ir['user_level'] > 3) { die("sorry nope go away"); } switch($_GET['action']) { case 'givecar': give_car_form(); break; case 'givecarsub': give_car_submit(); break; case 'addcar': addcar(); break; case 'editcar': editcar(); break; case 'delcar': delcar(); break; case 'garagebeg': garage_user_begin(); break; case 'garageuser': garage_user_view(); break; case 'delusercar': user_car_delete(); break; default: print "Error: This script requires an action."; break; } function addcar() { global $db, $ir, $c, $h, $userid; $name=$_POST['name']; $desc=$_POST['desc']; if($desc and $name) { $q=$db->query("SELECT * FROM cars_types WHERE carname='{$name}'"); if($db->num_rows($q)) { print "Sorry, you cannot have two car`s with the same name."; $h->endpage(); exit; } $db->query("INSERT INTO cars_types VALUES('NULL','$name','$desc', '{$_POST['carCOST']}','{$_POST['carACC']}','{$_POST['carHAN']}','{$_POST['carSPD']}','{$_POST['carSHD']}','{$_POST['carBUYABLE']}')"); print " {$name} added to the game."; stafflog_add("Created Car $name"); } else { print "<h3>Add car</h3><hr /> <form action='staff_cars.php?action=addcar' method='post'> car`s Name: <input type='text' name='name' /> car`s Description: <input type='text' name='desc' /> car`s cost: <input type='text' name='carCOST' /> car`s Acceleration: <input type='text' name='carACC' /> car`s Handling: <input type='text' name='carHAN' /> car`s Speed: <input type='text' name='carsPD' /> car`s Shield: <input type='text' name='carsHD' /> car`s carBUYABLE if 1=yes and 0=no: <input type='text' name='carBUYABLE' /> <input type='submit' value='Add car' /></form>"; } } function editcar() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $name=$_POST['name']; $desc=$_POST['desc']; $q=$db->query("SELECT * FROM cars_types WHERE carname='{$name}' AND carid!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two cars with the same name."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM cars_types WHERE carid={$_POST['id']}"); $old=$db->fetch_row($q); $db->query("UPDATE cars_types SET carname='$name', carDESC='$desc',carCOST='{$_POST['carCOST']}',carACC='{$_POST['carACC']}',carHAN='{$_POST['carHAN']}',carSPD='{$_POST['carSPD']}',carSHD='{$_POST['carSHD']}',carBUYABLE='{$_POST['carBUYABLE']}' WHERE carid={$_POST['id']}"); print "Car $name was edited successfully."; stafflog_add("Edited Car $name"); break; case "1": $q=$db->query("SELECT * FROM cars_types WHERE carid={$_POST['car']}"); $old=$db->fetch_row($q); print "<h3>Editing a car</h3><hr /> <form action='staff_cars.php?action=editcar' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['car']}' /> car`s Name: <input type='text' name='name' value='{$old['carNAME']}'/> car`s Description: <input type='text' name='desc' value='{$old['carDESC']}'/> car`s cost: <input type='text' name='carCOST' value='{$old['carCOST']}'/> car`s Acceleration: <input type='text' name='carACC' value='{$old['carACC']}'/> car`s Handling: <input type='text' name='carHAN' value='{$old['carHAN']}'/> car`s Speed: <input type='text' name='carSPD' value='{$old['carSPD']}'/> car`s Shield: <input type='text' name='carSHD' value='{$old['carSHD']}'/> car`s carBUYABLE if 1=yes and 0=no: <input type='text' name='carBUYABLE' value='{$old['carBUYABLE']}'/> <input type='submit' value='Edit Car' /></form>"; break; default: print "<h3>Editing a cars</h3><hr /> <form action='staff_cars.php?action=editcar' method='post'> <input type='hidden' name='step' value='1' /> Item: ".car_dropdown($c,'car')." <input type='submit' value='Edit car' /></form>"; break; } } function delcar() { global $db,$ir,$c,$h,$userid; if($_POST['car']) { $q=$db->query("SELECT * FROM cars_types WHERE carID={$_POST['car']}"); $old=$db->fetch_row($q); if($old['id']==1) { die("This car cannot be deleted."); } $db->query("DELETE FROM cars_types WHERE carID={$old['carID']}"); print "Car {$old['carname']} deleted."; stafflog_add("Deleted the car {$old['carname']}"); } else { print "<h3>Delete car</h3><hr /> Deleting a car is permanent Be sure of removing Cars <form action='staff_cars.php?action=delcar' method='post'> Car: ".car_dropdown($c, "car")." <input type='submit' value='Delete car' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! <a href='staff_users.php?action=reportsview' target='_blank'>> Back</a>"; } function garage_user_begin() { print "<h3>Viewing User garage</h3> You may browse this user's garage. <form action='staff_cars.php?action=garageuser' method='post'> User: ".user_dropdown($c,'user')." <input type='submit' value='View garage' /></form>"; } function garage_user_view() { if(!$_GET['st'] ) { $_GET['st']=0; } $start=abs((int) $_GET['st']); $cpp=20; global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $d=$db->query("SELECT username FROM users WHERE userid='{$_POST['user']}'"); $un=$db->fetch_single($d); $q=$db->query("SELECT cpcPLAYER FROM cars_playercars WHERE cpcPLAYER='{$_POST['user']}'", $c); $cars=mysql_num_rows($q); $pages=ceil($cars/$cpp); print "Pages: "; for($i=1; $i<=$pages; $i++) { $st=($i-1)*$cpp; if($st == $start) { print "<b>$i</b> "; } else { print "<a href='garage.php?st=$st' target='_blank'>$i</a> "; } } print " <table width=100% border=6> <tr style='background:#cc9966'><th>Car</th><th>Acceleration</th> <th>Handling</th><th>Speed</th><th>Shield</th><th>In Challenge?</th><th>delete</th></tr>"; $q=mysql_query("SELECT cp.*, ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON cp.cpcCAR=ct.carID WHERE cp.cpcPLAYER='{$_POST['user']}' LIMIT $start, $cpp", $c); $count=0; $cars=array(); while($r=$db->fetch_row($q)) { $count++; $acc=$r['cpcACCLV']*$r['carACC']; $han=$r['cpcHANLV']*$r['carHAN']; $spd=$r['cpcSPDLV']*$r['carSPD']; $shd=$r['cpcSHDLV']*$r['carSHD']; $q2=mysql_query("SELECT * FROM challenges WHERE chCHRCAR={$r['cpcID']} AND chSTATUS='open'", $c); if($db->num_rows($q2) == 1) { $challenge="<font color='red'>Yes</font>"; } else { $challenge="<font color='green'>No</font>"; } print "<tr><td>{$r['carNAME']} </td> <td>Lv{$r['cpcACCLV']} ($acc)</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td><td>$challenge</td> <td><a href='staff_users.php?action=delusercar'>Delete</td> </tr>"; $cars[$r['cpcID']]="{$r['carNAME']} - {$r['cpcACCLV']}/{$r['cpcHANLV']}/{$r['cpcSPDLV']}/{$r['cpcSHDLV']}"; } if($count == 0) { print "<tr><th colspan=6>No Cars In this players Garage</th></tr>"; } print "</td></tr></table>"; } function give_car_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving cars To User</h3> <form action='staff_cars.php?action=givecarsub' method='post'> User: ".user_dropdown($c,'user')." Cars: ".car_dropdown($c,'car')." <input type='submit' value='car Given ' /></form>"; } function give_car_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO cars_playercars VALUES('',{$_POST['user']},{$_POST['car']},1,1,1,1);",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of car ID {$_POST['car']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of car ID {$_POST['car']} to user ID {$_POST['user']}"); } $h->endpage(); ?>
  14. im not asking for a fix.. im fixing it... but if anyone can (HELP) by posting a good code if they have it. not asking to do it for me. sorry about that. ill fix it and ill post the fix. thanks i appreciate that you guys have taking time for me. ;) if you dont have the code and you dont wanna help, thats is something else.
  15. I would like to try but the code is all messed with http and bad link cause a forum changed or somthing. if anyone have it. i would love to have a copy of the script that work please. usually i fixe all the bad link but this time its harder. thx :)
  16. the script work very well but when i try to create a search area after clic add... its show: Column count doesn't match value count at row 1 so im stuck with the firstcontact. :) and by the way very nice mod. i like it. i find the solution in addareas.php find: implode(",", array_map("sqlesc", array($url, $display, $level, $display_name, $description, $Locked))). ")") or die(mysql_error()); and change by: implode(",", array_map("sqlesc", array($url, $display, $level, $display_name, $description, $Locked, $member))). ")") or die(mysql_error());   was missing the $member :)
  17. nice job its perfect thats was the mod i needed.
  18. thanks its ok now good work what about iteminfo.php did you find a way to show the image there too?
  19. Its seem that the code is missing some html... can you repost theoriginal code please. i have problem with this line print"</td><td>[img=itmpics/{$i[]";
  20. Bonjour Jonathan Mongrain,   Cet email confirme que Brandon Werner a accepté la somme de $50.00 CAD que vous avez envoyée.   ---------------------------------------------------------------- Détails du paiement ----------------------------------------------------------------   Montant : $50.00 CAD Numéro de transaction : 2C975650R9321282E Objet : myneocorp license pay by paypal via this guy [email protected] he doesnt anwser this mail anymore   in 2007. i made a lot of mod to generic rpg myself. would enjoy to share my mod with you. i can send some page that i did too if i dont get a database ill go with the raven thats cost only 15$ but ive done so many work for the generic rpg and i dont want to waste it only for a loss database. thanks for helping me... im not asking for the hole game i have my old version. only the database. ill have to make change to the database as well to fit the change that ive done in 2007. in the past it was on laguerredesgangs.com french version that ive translate myself too. hope you guys help me. [email protected]
  21. i have the game but my db is missing. can anyone send me the database that we need when we install the game. i have it 7 years ago... wanna reinstall the game online but miss the db.. send to [email protected] please
×
×
  • Create New...