Jump to content
MakeWebGames

Haunted Dawg

Members
  • Posts

    2,933
  • Joined

  • Last visited

    Never
  • Days Won

    1

Everything posted by Haunted Dawg

  1. Re: Events Recode   <?php require_once "globals.php"; echo <<<EOFS1 <style type="text/css"> .success { color: green; } .fail { color: red; } table { text-align: center; } </style> EOFS1; $_GET['delete'] = (!empty($_GET['delete']) && ctype_digit($_GET['delete']) && isset($_GET['delete']) ? abs(@intval($_GET['delete'])) : FALSE); $_GET['delall'] = (!empty($_GET['delall']) && ctype_digit($_GET['delall']) && isset($_GET['delall']) ? abs(@intval($_GET['delall'])) : FALSE); $_GET['delall2'] = (!empty($_GET['delall2']) && ctype_digit($_GET['delall2']) && isset($_GET['delall2']) ? abs(@intval($_GET['delall2'])) : FALSE); if($_GET['delete']) { $deleteEvent = sprintf("DELETE FROM `events` WHERE `evID` = %d AND `evTO` = %u", $_GET['delete'], abs(@intval($userid))); $do_deleteEvent = mysql_query($deleteEvent); if($do_deleteEvent === FALSE) { echo "".mysql_error().""; } echo "<h3 class='success'> Event Deleted </h3>"; } if($_GET['delall']) { echo "<h4>This will delete all your events</h4>"; echo "<h4>There is <span style='font-weight:bold;'> NO </span> undo, so be sure</h4>"; echo "<ul style='list-style-type:none;line-height:2em;'>"; echo "[*] [url='events.php?delall2=1'] Yes, delete all my events [/url] "; echo "[*] [url='events.php']No, go back[/url] "; echo "[/list]"; $h->endpage(); exit; } if($_GET['delall2']) { $getEventnum = sprintf("SELECT * FROM `events` WHERE `evTO` = %u", abs(@intval($userid))); $do_getEventnum = mysql_query($getEventnum); if($do_getEventnum === FALSE) { echo "".mysql_error().""; } $am = $db->num_rows($do_getEventnum); $deleteAll = sprintf("DELETE FROM `events` WHERE `evTO` = %u", abs(@intval($userid))); $do_deleteAll = mysql_query($deleteAll); printf("<h3 class='success' style='padding-bottom:10px;'> All <span style='font-weight:bold;'> %d </span> events you had, were deleted. </h3>", $am); echo "[url='events.php']Back[/url]"; $h->endpage(); exit; } echo "<h2 style='padding-bottom:15px;'> Latest Events </h2>"; echo "[url='events.php?delall=1'] Delete All Events [/url]"; $selectEvents = sprintf("SELECT * FROM `events` WHERE `evTO` = %u ORDER BY `evTIME` DESC LIMIT 10;", abs(@intval($userid))); $q = mysql_query($selectEvents); if($q === FALSE) { echo "".mysql_error().""; } echo "<table style='width:75%;border-spacing:1;padding-top:10px;'>"; echo "<tr>"; echo "<th>Time</th>"; echo "<th>Event</th>"; echo "<th>Links</th>"; echo "</tr>"; while($r = $db->fetch_row($q)) { echo "<tr>"; echo "<td>".date('F j Y, g:i:s a',$r['evTIME']); $new = (!$r['evREAD'] ? "<span style='padding-left: 15px;font-weight:bold;color:red;'> NEW </span>" : FALSE); echo $new; echo "</td>"; printf("<td> %s </td>", $r['evTEXT']); printf("<td> [url='events.php?delete=%d']Delete[/url] </td>", abs(@intval($r['evID']))); echo "</tr>"; } echo "</table>"; if($ir['new_events'] > 0) { $eventRead = sprintf("UPDATE `users` SET `evREAD` = 1 WHERE `evTO` = %u", abs(@intval($userid))); $do_eventRead = mysql_query($eventRead); if($do_eventRead === FALSE) { echo "".mysql_error().""; } $newEvents = sprintf("UPDATE `users` SET `new_events` = 0 WHERE `userid` = %u", abs(@intval($userid))); $do_newEvents = mysql_query($newEvents); if($do_newEvents === FALSE) { echo "".mysql_error().""; } } $h->endpage(); ?>   Try that.
  2. Re: [mccode v2] Stock Market. Working + Secured Code UPDATED
  3. I have made this stock market for people to use, i was going to sell but then thought about rather releasing as i have been releasing alot paid lately. I mainly made this for a client who had the old stock market but insecure and useless. Stocks can crash on here, if a stock crashes. The user will loose their shares. So well. Here we go. Create file stocks.php And add: <?php /* Start Copy Right Notice! */ /* # You do not re-distribute my files. # You do not claim this as your work. # You do not ask for money to other people for my work. # This is free not paid. # Leaving the copyright is a must (i know alot of you will just take it down :/) # All the work under this file is by written consent kyle mulder's and shall be in tact at all times! # A description of this file is bellow: This is a stock market, a working one, a non buggy one, a non exploitable one, a better one, more feature. Users can buy stocks and every 5 minutes the stock rate will change (like real life). Gives the users something to do. The stocks can crash every 5 minutes making everyone loose there investment and there cash. There will be a .15% that a stock can crash, more likely to happen quite often, but not all the time. If there is a possibility that a stock can crash every 5 minute's. That makes it: # 5 minutes => 1 Crash # 1 Hour => 12 Crashes # 1 Day => 288 Crashes The above is possibilites, does not mean it WILL always happen. Anyways lets get on with the file :) */ /* End Copy Right Notice! */ include_once('globals.php'); echo ' <style language="text/css"> .red { color: red; } .green { color: green; } .stock td { border: 1px black solid; } .stock th { border: 1px black solid; } </style> <h2>Stock Market</h2>'; $arrs = array('buy','log','sell','view'); $x = (isset($_GET['trip']) && ctype_alnum($_GET['trip']) && in_array($_GET['trip'], $arrs)) ? trim($_GET['trip']) : FALSE; # False making it not exist making it default page. switch($x) { case 'buy': buy_stock(); break; case 'sell': sell_stock(); break; case 'view': view_stock(); break; case 'log': view_stock_log(); break; default: stock_default(); break; } function view_stock_log() { global $ir,$h; $log = mysql_query("SELECT recordTIME,recordTEXT FROM `stock_records` WHERE `recordUSER` = ".$ir['userid']." ORDER BY `recordTIME` DESC") or die(mysql_error()); if(mysql_num_rows($log) == 0) { echo 'You do not have any log records.'; } else { while($soc = mysql_fetch_assoc($log)) { $time = date('F jS Y g:i:s', $soc['recordTIME']); echo '[b]'.$time.'[/b] '.str_replace('me', 'You', $soc['recordTEXT']).' '; } } } function sell_stock() { global $ir,$h; $id = abs(@intval($_GET['ID'])); $holding = mysql_query("SELECT holdingID,holdingSTOCK,holdingQTY FROM `stock_holdings` WHERE `holdingID` = ".$id." AND `holdingUSER` = ".$ir['userid']) or die(mysql_error()); if(mysql_num_rows($holding) == 0) { echo 'This holding ID does not exist, or you do not own it.'; } else { $soc = mysql_fetch_assoc($holding); $stock = mysql_query("SELECT stockNAME,stockNPRICE FROM `stock_stocks` WHERE `stockID` = ".$soc['holdingSTOCK']) or die(mysql_error()); $stock = mysql_fetch_assoc($stock); $tot = ($stock['stockNPRICE'] * $soc['holdingQTY']); mysql_query("DELETE FROM `stock_holdings` WHERE `holdingID` = ".$soc['holdingID']); mysql_query("INSERT INTO `stock_records` (`recordUSER`,`recordTIME`,`recordTEXT`) VALUES (".$ir['userid'].",unix_timestamp(),'me sold ".$soc['holdingQTY']." of stock ".$stock['stockNAME']." for ".money_formatter($tot)."')") or die(mysql_error()); mysql_query("UPDATE `users` SET `money` = (`money` + ".$tot.") WHERE `userid` = ".$ir['userid']) or die(mysql_error()); echo 'You sold '.number_format($soc['holdingQTY']).' stock of '.$stock['stockNAME'].' for '.money_formatter($tot).'!'; } } function view_stock() { global $ir,$h; $holdings = mysql_query("SELECT holdingID,holdingSTOCK,holdingQTY FROM `stock_holdings` WHERE `holdingUSER` = ".$ir['userid']) or die(mysql_error()); if(mysql_num_rows($holdings) == 0) { echo 'You do not hold any shares in any stocks atm.'; } else { echo ' <table border="0" cellspacing="0" cellpadding="0" class="stocks" width="50%"> <tr> <th>Stock Name</th> <th>Shares</th> <th>Sell Price</th> <th>Sell</th> </tr>'; while($soc = mysql_fetch_assoc($holdings)) { $stock = mysql_query("SELECT stockNAME,stockNPRICE FROM `stock_stocks` WHERE `stockID` = ".$soc['holdingSTOCK']) or die(mysql_error()); $stock = mysql_fetch_assoc($stock); echo ' <tr> <td>'.$stock['stockNAME'].'</td> <td>'.number_format($soc['holdingQTY']).'</td> <td>'.money_formatter($stock['stockNPRICE'] * $soc['holdingQTY']).'</td> <td>[url="'.$_SERVER['PHP_SELF'].'?trip=sell&ID='.$soc['holdingID'].'"]Sell Stock[/url]</td> </tr>'; } echo ' </table>'; } } function buy_stock() { global $ir,$h; $id = abs(@intval($_GET['ID'])); $rows = mysql_query("SELECT stockID FROM `stock_stocks` WHERE `stockID` = ".$id) or die(mysql_error()); if(mysql_num_rows($rows) == 0) { echo 'This stock does not exist.'; exit($h->endpage()); } if(isset($_POST['buy'])) { $amnt = abs(@intval($_POST['amnt'])); $fetch_stock = mysql_query("SELECT stockID,stockNPRICE,stockNAME FROM `stock_stocks` WHERE `stockID` = ".$id) or die(mysql_error()); $stock = mysql_fetch_assoc($fetch_stock); $mprice = ($stock['stockNPRICE'] * $amnt); if($ir['money'] <= $mprice) { echo 'You do not have enough money for this amount of stocks.'; exit($h->endpage()); } $stock_holds = mysql_query("SELECT holdingID FROM `stock_holdings` WHERE `holdingUSER` = ".$ir['userid']." AND `holdingSTOCK` = ".$stock['stockID']) or die(mysql_error()); if(mysql_num_rows($stock_holds)) { mysql_query("UPDATE `stock_holdings` SET `holdingQTY` = (`holdingQTY` + ".$amnt.") WHERE `holdingUSER` = ".$ir['userid']." AND `holdingSTOCK` = ".$stock['stockID']) or die(mysql_error()); } else { mysql_query("INSERT INTO `stock_holdings` (`holdingUSER`,`holdingSTOCK`,`holdingQTY`) VALUES (".$ir['userid'].",".$stock['stockID'].",".$amnt.")") or die(mysql_error()); } mysql_query("UPDATE `users` SET `money` = (`money` - ".$mprice.") WHERE `userid` = ".$ir['userid']); mysql_query("INSERT INTO `stock_records` (`recordUSER`,`recordTIME`,`recordTEXT`) VALUES (".$ir['userid'].",unix_timestamp(),'me bought ".$amnt." of stock ".$stock['stockNAME']." for ".money_formatter($mprice)."')") or die(mysql_error()); echo 'You successfuly bought '.number_format($amnt).' stocks of '.$stock['stockNAME'].'.'; } else { $stock = mysql_query("SELECT stockID,stockNAME,stockCHANGE,stockNPRICE,stockUD,stockOPRICE FROM `stock_stocks` WHERE `stockID` = ".$id) or die(mysql_error()); $stock = mysql_fetch_assoc($stock); $symb = ($stock['stockUD'] == 1) ? '<big>?</big>' : '<big>?</big>'; $class = ($stock['stockUD'] == 1) ? 'green' : 'red'; $blip = ($stock['stockUD'] == 1) ? '+' : '-'; $clor = ($stock['stockOPRICE'] < $soc['stockNPRICE']) ? 'green' : 'red'; echo ' <table border="0" cellspacing="0" width="50%"> <tr> <td>Stock Name</td> <td>'.$stock['stockNAME'].'</td> </tr> <tr> <td>Price Change</td> <td><span class="'.$class.'">'.$blip.' '.money_formatter($stock['stockCHANGE']).' '.$symb.'</span></td> </tr> <tr> <td>Original Price</td> <td>'.money_formatter($stock['stockOPRICE']).'</td> </tr> <tr> <td>Now Price</td> <td>'.money_formatter($stock['stockNPRICE']).'</td> </tr> <tr> <td>Buy Stock</td> <td> <form action="'.$_SERVER['PHP_SELF'].'?trip=buy&ID='.$id.'" method="post"> QTY: <input type="text" name="amnt" value="0" /> <input type="submit" value="Buy" name="buy" /> </form> </td> </tr> </table>'; } } function stock_default() { global $ir,$h; echo ' Here is a list of stocks available along with their price and such. -> [url="'.$_SERVER['PHP_SELF'].'?trip=view"]View your stocks[/url] -> [url="'.$_SERVER['PHP_SELF'].'?trip=log"]View your log[/url] <table border="0" cellspacing="0" cellpadding="0" class="stock" width="70%"> <tr> <th>Stock Name</th> <th>Stock Orig Price</th> <th>Stock Now Price</th> <th>Price Change</th> <th>View</th> </tr>'; $stocks = mysql_query("SELECT stockID,stockNAME,stockOPRICE,stockNPRICE,stockCHANGE,stockUD FROM `stock_stocks`") or die(mysql_error()); if(mysql_num_rows($stocks) == 0) { echo ' <tr> <td align="center" colspan="5">No stocks available</td> </tr> </table>'; exit($h->endpage()); } while($soc = mysql_fetch_assoc($stocks)) { $symb = ($soc['stockUD'] == 1) ? '?' : '?'; $class = ($soc['stockUD'] == 1) ? 'green' : 'red'; $blip = ($soc['stockUD'] == 1) ? '+' : '-'; $clor = ($soc['stockOPRICE'] < $soc['stockNPRICE']) ? 'green' : 'red'; $blic = ($soc['stockOPRICE'] < $soc['stockNPRICE']) ? '+' : '-'; echo ' <tr> <td>'.$soc['stockNAME'].'</td> <td>'.money_formatter($soc['stockOPRICE']).'</td> <td><span class="'.$clor.'">'.$blic.' '.money_formatter($soc['stockNPRICE']).'</span></td> <td><span class="'.$class.'">'.$blip.' '.money_formatter($soc['stockCHANGE']).' '.$symb.'</span></td> <td>[url="'.$_SERVER['PHP_SELF'].'?trip=buy&ID='.$soc['stockID'].'"]Buy Or View[/url]</td> </tr>'; } echo ' </table>'; } $h->endpage(); ?> Now Run these SQLs: CREATE TABLE `stock_stocks` ( `stockID` BIGINT(25) NOT NULL AUTO_INCREMENT, `stockNAME` VARCHAR(255) NOT NULL DEFAULT 'Default Stock Name', `stockOPRICE` BIGINT(25) NOT NULL DEFAULT '0', `stockNPRICE` BIGINT(25) NOT NULL DEFAULT '0', `stockCHANGE` INT(25) NOT NULL DEFAULT '50', `stockUD` TINYINT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`stockID`) ) ENGINE=MyISAM; CREATE TABLE `stock_holdings` ( `holdingID` BIGINT(25) NOT NULL AUTO_INCREMENT, `holdingUSER` BIGINT(25) NOT NULL DEFAULT '0', `holdingSTOCK` BIGINT(25) NOT NULL DEFAULT '0', `holdingQTY` BIGINT(25) NOT NULL DEFAULT '0', PRIMARY KEY (`holdingID`) ) ENGINE=MyISAM; CREATE TABLE `stock_records` ( `recordUSER` BIGINT(25) NOT NULL DEFAULT '0', `recordTIME` BIGINT(25) NOT NULL DEFAULT '0', `recordTEXT` TEXT NOT NULL ) ENGINE=MyISAM; Now add this code to your five minute cron/timestamp. $stocks = mysql_query("SELECT stockID FROM `stock_stocks`"); while($soc = mysql_fetch_assoc($stocks)) { $rand = mt_rand(1,2); if($rand == 2) { $mr = mt_rand(10,250); mysql_query("UPDATE `stock_stocks` SET `stockUD` = 2, `stockCHANGE` = ".$mr.", `stockNPRICE` = (`stockNPRICE` - ".$mr.") WHERE `stockID` = ".$soc['stockID']); } else { $mr = mt_rand(10,250); mysql_query("UPDATE `stock_stocks` SET `stockUD` = 1, `stockCHANGE` = ".$mr.", `stockNPRICE` = (`stockNPRICE` + ".$mr.") WHERE `stockID` = ".$soc['stockID']); } } include_once('global_func.php'); $sel = mysql_query("SELECT stockID,stockNAME FROM `stock_stocks` WHERE `stockNPRICE` < 0"); while($soc = mysql_fetch_assoc($sel)) { if(mysql_num_rows(mysql_query("SELECT holdingID FROM `stock_holdings` WHERE `holdingSTOCK` = ".$soc['stockID']))) { $user = mysql_query("SELECT holdingUSER FROM `stock_holdings` WHERE `holdingSTOCK` = ".$soc['stockID']); $user = mysql_fetch_assoc($user); event_add($user['holdingUSER'], 'Stock '.$soc['stockNAME'].' crashed, you lost all your shares.'); } mysql_query("DELETE FROM `stock_holdings` WHERE `holdingSTOCK` = ".$soc['stockID']); mysql_query("UPDATE `stock_stocks` SET `stockUD` = 1,`stockCHANGE` = 0,`stockNPRICE` = `stockOPRICE` WHERE `stockID` = ".$soc['stockID']); } Now the staff panel. Call it staff_stocks.php <?php /* Start Copy Right Notice! */ /* # You do not re-distribute my files. # You do not claim this as your work. # You do not ask for money to other people for my work. # This is free not paid. # Leaving the copyright is a must (i know alot of you will just take it down :/) # All the work under this file is by written consent kyle mulder's and shall be in tact at all times! # A description of this file is bellow: This is a stock market, a working one, a non buggy one, a non exploitable one, a better one, more feature. Users can buy stocks and every 5 minutes the stock rate will change (like real life). Gives the users something to do. The stocks can crash every 5 minutes making everyone loose there investment and there cash. There will be a .15% that a stock can crash, more likely to happen quite often, but not all the time. If there is a possibility that a stock can crash every 5 minute's. That makes it: # 5 minutes => 1 Crash # 1 Hour => 12 Crashes # 1 Day => 288 Crashes The above is possibilites, does not mean it WILL always happen. Anyways lets get on with the file :) */ /* End Copy Right Notice! */ include_once('sglobals.php'); echo '<h2>Stock Panel</h2>'; $x = (isset($_GET['action']) && ctype_alnum($_GET['action'])) ? trim($_GET['action']) : FALSE; switch($x) { default: echo 'Need an action dude.. I need a freaking action, do you want me to die here!'; break; case 'add': add_stock(); break; case 'del': delete_stock(); break; case 'edit': edit_stocks(); break; case 'editn': edit_stock(); break; } function edit_stocks() { global $ir,$h; echo 'Edit a stock bellow. <form action="'.$_SERVER['PHP_SELF'].'?action=editn" method="post">'; $stock = mysql_query("SELECT stockNAME,stockID FROM `stock_stocks`") or die(mysql_error()); while($soc = mysql_fetch_assoc($stock)) { echo '<input type="radio" value="'.$soc['stockID'].'" name="ID" /> '.$soc['stockNAME'].' '; } echo ' <input type="submit" value="Edit Stock" /> </form>'; } function edit_stock() { global $ir,$h; $ID = abs(@intval($_REQUEST['ID'])); $stre = mysql_query("SELECT stockID,stockNAME,stockOPRICE,stockNPRICE FROM `stock_stocks` WHERE `stockID` = ".$ID) or die(mysql_error()); if(mysql_num_rows($stre) == 0) { echo 'Invalid Stock!'; exit($h->endpage()); } if(isset($_POST['name'])) { $name = mysql_real_escape_string($_POST['name']); $nprice = abs(@intval($_POST['nprice'])); $oprice = abs(@intval($_POST['oprice'])); mysql_query("UPDATE `stock_stocks` SET `stockNAME` = '".$name."',`stockOPRICE` = ".$oprice.", `stockNPRICE` = ".$nprice." WHERE `stockID` = ".$ID) or die(mysql_error()); echo 'Stock edited successfuly'; } else { $row = mysql_fetch_assoc($stre); echo 'Editing stock '.$row['stockNAME'].' <form action="'.$_SERVER['PHP_SELF'].'?action=editn&ID='.$ID.'" method="post"> Stock Name: <input type="text" name="name" value="'.$row['stockNAME'].'" /> Stock Orig Price: <input type="text" name="oprice" value="'.$row['stockOPRICE'].'" /> Stock Now Price: <input type="text" name="nprice" value="'.$row['stockNPRICE'].'" /> <input type="submit" value="Edit Stock" /> </form>'; } } function add_stock() { global $ir,$h; if(isset($_POST['name'])) { $name = mysql_real_escape_string($_POST['name']); $orgp = abs(@intval($_POST['origp'])); mysql_query("INSERT INTO `stock_stocks` (`stockNAME`,`stockOPRICE`,`stockNPRICE`) VALUES ('".$name."',".$orgp.",".$orgp.")") or die(mysql_error()); echo 'Stock Created!'; } else { echo ' Add a setock bellow. <form action="'.$_SERVER['PHP_SELF'].'?action=add" method="post"> Name: <input type="text" name="name" /> Original Price: <input type="text" name="origp" value="2000" /> <input type="submit" value="Add Stock" /> </form>'; } } function delete_stock() { global $ir,$h; if(isset($_POST['del'])) { $id = abs(@intval($_POST['stock'])); mysql_query("DELETE FROM `stock_stocks` WHERE `stockID` = ".$id) or die(mysql_error()); mysql_query("DELETE FROM `stock_holdings` WHERE `holdingSTOCK` = ".$id) or die(mysql_error()); echo 'Stock Deleted.'; } else { echo 'Delete a stock bellow. <form action="'.$_SERVER['PHP_SELF'].'?action=del" method="post">'; $stock = mysql_query("SELECT stockNAME,stockID FROM `stock_stocks`") or die(mysql_error()); while($soc = mysql_fetch_assoc($stock)) { echo '<input type="radio" value="'.$soc['stockID'].'" name="stock" /> '.$soc['stockNAME'].' '; } echo ' <input type="submit" value="Delete Stock" name="del" /> </form>'; } } $h->endpage(); ?> Links: Stocks<hr /> -> Edit Stock -> Add Stock -> Delete Stock This can be seen working on http://www.convictsunleashed.com/demo/ , The cron on the test site is built into the stocks.php so people can see the change. The mod was tested by me & karlos. But created by me. Enjoy!
  4. Re: If you have an item, you can create another? Lithium, your using IN() meaning that the inv_id must be in either 32,33,34 and you should use `inv_itemid` since that's what were searching. Legroll's [email protected] ill help you just pm me.
  5. Re: Mono District 0 Days, 0 hour's and 0 second's :)
  6. Re: If you have an item, you can create another? As i said:   <?php include_once('globals.php'); echo '<h2>Lets Make Pizza!</h2>'; $stuff = mysql_query("SELECT inv_id FROM `inventory` WHERE `inv_itemid` = 32 AND `inv_itemid` = 33 AND `inv_itemid` = 34 AND `inv_userid` = ".$ir['userid']); if(mysql_num_rows($stuff)) { item_add($ir['userid'], 35, 1); item_remove($ir['userid'], 32, 1); item_remove($ir['userid'], 33, 1); item_remove($ir['userid'], 34, 1); echo 'You successfuly made a pizza!'; } else { echo 'You do not have the sufficient ingredients yet.'; } $h->endpage(); ?>   Post any error's.
  7. Re: If you have an item, you can create another?   $stuff = mysql_query("SELECT inv_id FROM `inventory` WHERE `inv_itemid` = 32 AND `inv_itemid` = 33 AND `inv_itemid` = 34 AND `inv_userid` = ".$ir['userid']); if(mysql_num_rows($stuff)) { item_add($ir['userid'], 35, 1); item_remove($ir['userid'], 32, 1); item_remove($ir['userid'], 33, 1); item_remove($ir['userid'], 34, 1); echo 'You successfuly made a pizza!'; } else { echo 'You do not have the sufficient ingredients yet.'; }   _Eagle, why select the entire inventory when only certain required? The above should work :)
  8. Re: If you have an item, you can create another?   $stuff = mysql_query("SELECT inv_id FROM `inventory` WHERE `inv_itemid` = 32 AND `inv_itemid` = 33 AND `inv_itemid` = 34"); if(mysql_num_rows($stuff)) { echo TRUE; } else { echo FALSE; }
  9. Re: TwIsTeD WiShEs ! Granted, but only lasted 1 minuted. I wish people would treat MTG right for a hole year :P
  10. Re: [mccode2] problems with a single sql line and need help Is it not common sense to close of your brackets and ()?'s   { $q3=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$odata['equip_armor']}, {$odata['equip_helmet']}, {$odata['equip_boots']}, {$odata['equip_amulet']}, {$odata['equip_braclet']}, {$odata['equip_ring']}, {$odata['equip_special']} ORDER BY rand()"); if($db->num_rows($q3)) { $mydamage-=$db->fetch_single($q3); }   should be   { $q3=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$odata['equip_armor']}, {$odata['equip_helmet']}, {$odata['equip_boots']}, {$odata['equip_amulet']}, {$odata['equip_braclet']}, {$odata['equip_ring']}, {$odata['equip_special']}) ORDER BY rand()"); if($db->num_rows($q3)) { $mydamage-=$db->fetch_single($q3); }
  11. Re: Hacked :( Casanova is craig. So your wrong there ant, i speak to craig some time's on msn.
  12. Re: Mccodes V2. Music Player. $40 Trying out this mod on your game. 1.- Error: Warning: fopen(/home2/respect/public_html/songs/11/Testing.html) [function.fopen]: failed to open stream: Permission denied in /home2/respect/public_html/musicplayer.php on line 31 can't open file 2.- If anyone maliciouse wanted to do damage to your site. Your site could pretty much be injected in how many way's. Good luck with your sale.
  13. Re: [mccode v2] Weather Gym [$1.00] Code updated on demo site.
  14. Re: [Mccodes V2] Age + Age restriction on buying items   "; if($r['daysold'] < 13) print "Age: Child "; } if($r['daysold'] > '13' && $r['daysold'] < '18') print "Age: Teenager "; } if($ir['daysold'] > 18) print "Age: Adult "; print "   Should be   "; if($r['daysold'] < 13) { print "Age: Child "; } if($r['daysold'] > '13' && $r['daysold'] < '18') { print "Age: Teenager "; } if($ir['daysold'] > 18) { print "Age: Adult "; } print "
  15. Re: cron_day.php   <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die("Cron Not Ran"); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } mysql_query("DELETE FROM fedjail WHERE fed_days=0"); mysql_query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET gameturns=50"); mysql_query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); mysql_query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); mysql_query('UPDATE users SET hoesbuy = 0 WHERE hoesbuy > 0'); $stockreset = rand(100,500); //100 is the minimum it will reset to and 500 is maximum, you can change mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); while($r=$db->fetch_row($q)) $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $rem=$db->query("SELECT * FROM users WHERE fedjail=0 AND user_level>0 AND reminder=0"); while($rem1=$db->fetch_row($rem)) { $lon=($rem1['laston'] > 0) ?date('F j, Y g:i:s a',$rem1['laston']) : "Never"; if($rem1['laston'] > 0) { $la=time()-$rem1['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; if ($la>30) { $db->query("UPDATE users SET reminder=1 WHERE userid={$rem1['userid']}"); // send email. $site_name = "The Destroyers"; $site_mail = "[email protected]"; $bericht = "Inactive Reminder.\n\n"; $bericht .= "Username: ".$rem1['username']."\n"; $bericht .= "Password: ".$rem1['password']."\n"; $bericht .= "Email: ".$rem1['email']."\n"; $bericht .= "\n"; $bericht .= "We have noticed that you have not logged in over 1 month. A lot of changes have happened in our site since then. Why don't you come and try it out. Your account details are still active. So come on and lets all have fun together."; mail($rem1['email'],"Welcome to ".$site_name,$bericht,"From: ".$site_name." <".$site_mail.">"); } } } } } ?>
  16. Re: [mccodes v2] sendcash.php / Same IP Stop Sorry to say, but i think the above code fails. You are selecting a lastip from the users where the userid is your id, not resulting in the id of the other person. I personally prefer this:   $sql = mysql_query("SELECT `userid` FROM `users` WHERE `lastip` = '".$_SERVER['REMOTE_ADDR']."',`lastip_login` = '".$_SERVER['REMOTE_ADDR']."',`lastip_signup` = '".$_SERVER['REMOTE_ADDR']."'"); if(mysql_num_rows($sql) != 0) { echo 'Bam, i cought you! :D. No you can not send anything to this player because your ip results to theirs. Bye.'; $h->endpage(); exit; }
  17. Re: Questions about languages. 1.- 16 2.- South Africa 3.- 4 - Spanish, English, Afrikaanse (Similar to dutch), bit of french. 4.- Spanish => Mexico English => Home Language Afrikaanse => Home Language French => School
  18. Re: Funney Error Simple, just look for any image tag's which don't have a link. Like this: Those cause double page load.
  19. Re: Cpanel File Manager V2 from game I actualy finished created a full on file editing system. Admins can edit specific file's and admin's can restrict others and give others the ability to edit page's. If they try to include the settings file or the class file it automaticly strips it out and says echo ''; It actualy work's pretty decent.
  20. Re: Rise Of Lycans I think i must put a foot in where needed. Samz sent the $30 to my paypal for sniper-wars.com, mike then asked me to transfer it to his "paypal" which was just created to buy mods with. The next day i logged in to find i had a charge back. I immediatly got hold of samz and set up sniper-wars.info for him. There for setting up a backup. He never wanted the site and sniper-wars.info is still just standing, he canceled the chargeback. And i do have to say. Mike you are in the wrong possession to say it is your game. You sold it to samz, samz can still have it if he wants like i said. And no you are not in -$30 because i sent every thing to you. And thats the honest story.
  21. Re: Algorithm of all mafia games He is asking for algorithm if attack won % and loss % etc.
  22. Re: What are you listening to right now ? A classic song i like, is one that goes like "With out you, i dont want nobody baby" by yvonne elliman, she a great singer. Only reason why i like it is because my ex dedicated it to me after 3 years going out and reason to breaking up was me leaving mexico.
  23. Re: Looking for a one click attack system that works with V2   Heck, I'd do it free.. Why quote my post when i never set the price?
  24. Re: Looking for a one click attack system that works with V2 That's because it will be secure, and not vulnerable to refreshing and decent coding.
  25. Re: need help with crons Technically you would need a big ass insert, this is because, the cron's do not call in the global_func.php. Well on my file and to my knowledge it does not. But i have not messed with mccodes v2 file's for quite some time.
×
×
  • Create New...