Jump to content
MakeWebGames

BlueDevil23

Members
  • Posts

    328
  • Joined

  • Last visited

Everything posted by BlueDevil23

  1. Re: Eregi - Ereg They also could have meant it was "bad" in the sense that preg_match() is preferred, because it is faster.
  2. Re: [v2] Fish & Chippy mod It's ok illusions, you weren't aware, and it has been taken care of.
  3. Re: [mccode v2] Lucky Boxes   Can do. :) Code updated.
  4. Re: [mccode v1 + v2] Lucky Boxes Sorry about that Assault, I don't nor ever have used or experimented with V1 Thanks AlabamaHit :)
  5. Got really bored late one night, so just picked something I could recode pretty quickly, and give me something to do. So, here it is, all it basically is, is more customizable, and overall programmed better than the original. Just replace lucky.php with this   <?php /*------------------------------------------- - Made by BlueDevil23 - Please do not resell - Blah blah blah - Like people will actually keep this here - =) -------------------------------------------*/ require_once "globals.php"; echo "<style type='text/css'>"; echo ".success { color: green; }"; echo ".fail { color: red; }"; echo "</style>"; /*---------------------------------------- Configs | ----------------------------------------*/ $boxprice = 100; // Price of each box $boxlimit = 5; // Maximum amount of boxes an user can open a day $mincrystals = 1; // Minimum amount of crystals a user can win, see Case 1 $maxcrystals = 5; // Maximum amount of crystals a user can win, see Case 1 $minmoney = 100; // Minimum amount of money a user can win, see Case 2 $maxmoney = 300; // Maximum amount of money a user can win, see Case 2 $itmarray = array(1, 2, 3, 4); // Item IDs of possible items a user can win, see Case 4 /*---------------------------------------- End Configs | ----------------------------------------*/ $boxplural = (($boxlimit > 1) ? $boxplural = 'es' : $boxplural = ''); echo "<h2> Lucky Boxes </h2>"; printf("<h4 style='padding-bottom:5px;'> You may open up to %d box%s a day </h4>", abs(@intval($boxlimit)), mysql_real_escape_string(trim($boxplural))); printf("<h4 style='padding-bottom:20px;'> Today, you have opened %d, so far. </h4>", abs(@intval($ir['boxes_opened']))); $_GET['open'] = ((!empty($_GET['open']) && ctype_digit($_GET['open']) && isset($_GET['open'])) ? $_GET['open'] = abs(@intval($_GET['open'])) : $_GET['open'] = ""); if($_GET['open']) { if($ir['boxes_opened'] >= $boxlimit) { die("Sorry, you have already opened $boxlimit box$boxplural today. Come back tomorrow."); } if($ir['money'] < $boxprice) { die("Sorry, it costs \$$boxprice to open a box. Come back when you have enough."); } $num = mt_rand(1, 4); mysql_query(sprintf("UPDATE `users` SET `boxes_opened` = `boxes_opened` + '1', `money` = `money` - ('%d') WHERE userid = ('%u')", abs(@intval($boxprice)), abs(@intval($userid)))) or die(mysql_error()); switch($num) { case 1: $tokens = mt_rand($mincrystals, $maxcrystals); $singular = (($tokens > 1) ? $singular = 's' : $singular = ''); printf("<h3 class='success'> You gained %d crystal%s </h3>", abs(@intval($tokens)), mysql_real_escape_string(trim($singular))); mysql_query(sprintf("UPDATE `users` SET `crystals` = `crystals` + ('%d') WHERE `userid` = ('%u')", abs(@intval($tokens)), abs(@intval($userid)))) or die(mysql_error()); break; case 2: $money = mt_rand($minmoney, $maxmoney); printf("<h3 class='success'> You gained \$%d </h3>", abs(@intval($money))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` + ('%d') WHERE `userid` = ('%u')", abs(@intval($money)), abs(@intval($userid)))) or die(mysql_error()); break; case 3: $stole = min(rand($ir['money']/10, $ir['money']/5), 5000); (($ir['money'] < $stole) ? $stole = $ir['money'] : $stole = $stole); printf("<h3 class='fail'> You lost \$%d </h3>", abs(@intval($stole))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` - ('%d') WHERE `userid` = ('%u')", abs(@intval($stole)), abs(@intval($userid)))) or die(mysql_error()); break; case 4: $item = array_rand($itmarray); echo "<h3 class='success'> You won a random item, check your inventory for it! </h3>"; item_add(abs(@intval($userid)), $item, 1); break; } echo "<ul style='list-style-type:none;line-height:2em;'> [*][url='lucky.php?open=1'] Open Another Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } else { printf("A man comes up to you and whispers, \"I have magical boxes, I'll let you open one for \$%d. Deal or no deal?", abs(@intval($boxprice))); echo "<ul style='list-style-type:none;line-height:2em;padding-top:15px;'> [*][url='lucky.php?open=1'] Open One Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } $h->endpage(); ?>   For V1 -- Thanks to Assault :)   <?php /*------------------------------------------- - Made by BlueDevil23 - Please do not resell - Blah blah blah - Like people will actually keep this here - =) -------------------------------------------*/ 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,$cm); $h->menuarea(); echo "<style type='text/css'>"; echo ".success { color: green; }"; echo ".fail { color: red; }"; echo "</style>"; /*---------------------------------------- Configs | ----------------------------------------*/ $boxprice = 100; // Price of each box $boxlimit = 5; // Maximum amount of boxes an user can open a day $mincrystals = 1; // Minimum amount of crystals a user can win, see Case 1 $maxcrystals = 5; // Maximum amount of crystals a user can win, see Case 1 $minmoney = 100; // Minimum amount of money a user can win, see Case 2 $maxmoney = 300; // Maximum amount of money a user can win, see Case 2 $itmarray = array(1, 2, 3, 4); // Item IDs of possible items a user can win, see Case 4 /*---------------------------------------- End Configs | ----------------------------------------*/ $boxplural = (($boxlimit > 1) ? $boxplural = 'es' : $boxplural = ''); echo "<h2> Lucky Boxes </h2>"; printf("<h4 style='padding-bottom:5px;'> You may open up to %d box%s a day </h4>", abs(@intval($boxlimit)), mysql_real_escape_string(trim($boxplural))); printf("<h4 style='padding-bottom:20px;'> Today, you have opened %d, so far. </h4>", abs(@intval($ir['boxes_opened']))); $_GET['open'] = ((!empty($_GET['open']) && ctype_digit($_GET['open']) && isset($_GET['open'])) ? $_GET['open'] = abs(@intval($_GET['open'])) : $_GET['open'] = ""); if(isset($_GET['open'])) { if($ir['boxes_opened'] >= $boxlimit) { die("Sorry, you have already opened $boxlimit box$boxplural today. Come back tomorrow."); } if($ir['money'] < $boxprice) { die("Sorry, it costs \$$boxprice to open a box. Come back when you have enough."); } $num = mt_rand(1, 4); mysql_query(sprintf("UPDATE `users` SET `boxes_opened` = `boxes_opened` + '1', `money` = `money` - ('%d') WHERE userid = ('%u')", abs(@intval($boxprice)), abs(@intval($userid)))) or die(mysql_error()); switch($num) { case 1: $tokens = mt_rand($mincrystals, $maxcrystals); $singular = (($tokens > 1) ? $singular = 's' : $singular = ''); printf("<h3 class='success'> You gained %d crystal%s </h3>", abs(@intval($tokens)), mysql_real_escape_string(trim($singular))); mysql_query(sprintf("UPDATE `users` SET `crystals` = `crystals` + ('%d') WHERE `userid` = ('%u')", abs(@intval($tokens)), abs(@intval($userid)))) or die(mysql_error()); break; case 2: $money = mt_rand($minmoney, $maxmoney); printf("<h3 class='success'> You gained \$%d </h3>", abs(@intval($money))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` + ('%d') WHERE `userid` = ('%u')", abs(@intval($money)), abs(@intval($userid)))) or die(mysql_error()); break; case 3: $stole = min(rand($ir['money']/10, $ir['money']/5), 5000); (($ir['money'] < $stole) ? $stole = $ir['money'] : $stole = $stole); printf("<h3 class='fail'> You lost \$%d </h3>", abs(@intval($stole))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` - ('%d') WHERE `userid` = ('%u')", abs(@intval($stole)), abs(@intval($userid)))) or die(mysql_error()); break; case 4: $item = array_rand($itmarray); echo "<h3 class='success'> You won a random item, check your inventory for it! </h3>"; item_add(abs(@intval($userid)), $item, 1); break; } echo "<ul style='list-style-type:none;line-height:2em;'> [*][url='lucky.php?open=1'] Open Another Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } else { printf("A man comes up to you and whispers, \"I have magical boxes, I'll let you open one for \$%d. Deal or no deal?", abs(@intval($boxprice))); echo "<ul style='list-style-type:none;line-height:2em;padding-top:15px;'> [*][url='lucky.php?open=1'] Open One Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } $h->endpage(); ?>   Run this SQL statement (V1 only) -- Thanks to Crazy-T :)   ALTER TABLE `users` ADD `boxes_opened` INT(11) NOT NULL DEFAULT '0'   Add this to your day cron (V1 only) -- Thanks Alabamahit :)   mysql_query("UPDATE users set boxes_opened = 0");   You can add more cases to it, by simply following the same format of the other cases, and adjusting the $num variable.     edit: Small updates
  6. Re: [mccode v2] Tag Mod (Complete)   How is is_string() pointless? It checks to see if the supplied argument, is a.... string. Therefore, it has a purpose. You are right though, ctype_alpha() could have been used, and performed the same task...
  7. Re: [mccode v2] Tag Mod (Complete) It looks like the forum parsed the tagtrader.php code incorrectly. I would repost it if I were you.
  8. Re: [MCCodes V2] Jail/Hosp Count :O ZA is alive?! :P lol
  9. Re: Wanted-criminals.net   How does it :) By lowering yourself to his standards. Be the bigger man...
  10. Re: [v2 $varies] Einey's Mod Shop (Read the store info before posting) This thread is split from another one, so you don't exactly see the whole thing, unless you put it all together. She is not simply advertising her game, but the main topic would show, she was selling mods, and wanted you to sign up to check them out. Hope that clears up some confusion.
  11. Re: [v2 $varies] Einey's Mod Shop (Read the store info before posting) Its not that it was the worst... It was that, I had already split the topic, before your post, and you can't move single posts to another topic. So, like I said before, simply repost in the split topic, if necessary.
  12. Re: [v2 $varies] Einey's Mod Shop (Read the store info before posting) I removed yours cause it was still bashing, if you wish to repost it, post it in the split topic of this... I have no reason, to remove yours Alabama, it is simply an opinion, and doesn't hurt sales, if someones is truly interested in a mod, they will decide for themselves if it overpriced or not. P.S. - Alabama -- PM the topic, and it will be taken care of if necessary, I do miss some stuff ya know. lol
  13. Re: Hitman Players [$30] Did I miss something? Is there is a reason Einey constantly, attacks Dazza on hardly offensive comments? Sure, Einey is right, in the end, you shouldn't be slandering people or making false accusations. But, before all that why over a-nalyze, and pick apart everything he says as offensive? Especially in your other topic, he asked a simple question, about the grab bags, but apparently that was offensive... So apparently I missed something before this between you two, or are you two the next Killah and Zero :lol:
  14. Re: [v2 $varies] Einey's Mod Shop (Read the store info before posting) Topic split. Keep the garbage out of this one.
  15. Re: [V2] New Five Minute Cron Niiiiiiice. Much improved over the original.
  16. Re: Updating an area with new text inputed by user? Check out my AJAX preferences, I did exactly what your looking for with the all of it, but namely the User Signatures - which will probably help you most. * Keep in mind I use the Dojo Toolkit for the AJAX calls here. http://criminalexistence.com/ceforums/h ... 85#p121985 If you need more help, you know where to catch me, I'm always in IRC...
  17. Re: [mccode V2] Ajax Shoutbox. [$12.00]   He stole and changed your code. I have worked with him and he often bragged about doing that type of thing. Usually I would let this kind of thing go. It happens on CE everyday, "he says, she says," kind of thing. Since this is a Paid Mod topic though, I am trying to keep garbage out of them. So, if the allegations are true, prove it. Not in this topic, but by PM. Thanks.
  18. Re: PLEASE DONT LISTEN TO SKULL ABOUT BUYING LW CODES ITS A SCAM   Here you go: http://tinyurl.com/apcuwf That site is amazing, eh Cronus lol. I'm sure Sim would agree xD.
  19. Re: [McCodes]No right click script That is honestly disturbing, POG1 lol.
  20. Re: [McCodes][v2] Event Layout Mod   Javascript, ... big difference :P
  21. Re: [Help]Scrollbars   Will always be? How does that make any sense? Firefox never was, and still currently is not, on top... Do you want to continue using IE, so be it. http://news.bbc.co.uk/1/hi/technology/7784908.stm And only reason why IE is the most browser used. Is because people buy microsoft computer's. I use IE?! :o How come no one told me. I've used FF since it came out, and in fact, despise Internet Explorer. Sure, that probably is true, that most people use MSIE because it comes pre-installed on their computer, but what's your point? We were talking about which is on top, and whether or not, it comes installed, doesn't change the fact that it is the most widely used browser.
  22. Re: [Help]Scrollbars   Will always be? How does that make any sense? Firefox never was, and still currently is not, on top...
  23. Re: What is Suhosin? http://tinyurl.com/cakwzx
  24. Re: [mccodes] Jail Bust Item Reward [$5] I split and removed half of the topic yesterday, when the arguing began. The rest of the topic is in the Archive. As for Alabamhit's post, I only left that one there, because of his explanation, and apology to Arson.
  25. Re: Dogdy bussines Lol.... just cause I am bored... It's checks.... no apostrophe.
×
×
  • Create New...