Jump to content
MakeWebGames

Magictallguy

Administrators
  • Posts

    2,124
  • Joined

  • Last visited

  • Days Won

    144

Everything posted by Magictallguy

  1. Your questions have been answered in the original topic. Also, sorry, I didn't want to steal your Pusher thunder :P
  2. @Zettieee and I have been working on this to get it to work with both v2 and v2.0.5b and we've confirmed it working on both platforms (with 1 uncomment for v2.0.5b) I can now also confirm that it works with gRPG There's a demo of it available here, an account will be required (it's entirely free to sign up) or you can use the demo (demo:demo) account Purchase info: All we're asking for is $20 and it comes with free installation (optional)! You can purchase from myself directly (I intend to add it to the MC Codes mod list) I accept PayPal ([email protected]) I need help! Support is offered to all who need it! Simply message me here and I'll respond within 24 hours Extendibility: BlueImp is fairly extendible, but I highly recommend reading through BlueImp's wiki first. Staff functions? The chat is designed to go based on the default MC Codes user_level permissions. (2 = admin, 3/5 = moderator, etc.) Administrators have all rights (as you would expect), which include kick/bans and view user IP (built-in) with room for more should you want them I've also wrote up a chat log for staff members (screenshot below) What else? There are multiple things this chat can do. From a simple roll of a die (or multiple, the choice is yours!) to ignoring other users or talking directly to them privately - a great feature for those who like to role play, or simply want to talk to each other using a method much faster than most games' in-built mail system. Users can also change their displayed name - though, in the demo version, I've disabled this feature. Chat log
  3. OMG ColdBlooded liked it! :D
  4.   ALTER TABLE user_pagelogs ADD string VARCHAR( 255 ) NOT NULL DEFAULT '', ADD extra TEXT NOT NULL; -- May want to change to LONGTEXT as your game increases   $extra = serialize($_REQUEST); $db->query("INSERT INTO user_pagelogs (user, time, page, string, extra) VALUES (".$userid.", ".time().", '".$db->escape($_SERVER['PHP_SELF'])."', '".$db->escape($_SERVER['QUERY_STRING'])."', '".$db->escape($extra)."')");   Everything1 is logged. Use unserialize() in the log view - make sure to prevent it from parsing as code on output 1 Not actually everything, but most of it..
  5. Staff panel here WARNING! This has been tested for parse errors only. Please report any bugs here
  6. if($theUsersPassword != (md5($_POST['password']) || hash('sha512', $_POST['password']))) exit("Incorrect"); /* Edit - addition to what Dayo said! This part will need to go *below* $mem=$db->fetch_row($q); in authenticate.php */ if($theUsersPassword == md5($_POST['password'])) $db->query("UPDATE users SET userpass = '".hash('sha512', $_POST['password'])."' WHERE userid = ".$mem['userid']); No need to add anything to the database then. You may wish to increase the `users`.`userpass` from a VARCHAR to a TEXT
  7. We all know MC Craps here, your reasons don't need to be said :P   Agreed   Most of the actual developers for hire here and more than capable of working under orders, we wouldn't get clients that way ;)
  8. I can build it exactly how you want it. If you want it to be similar to MC Craps, then I can give you that. If you want something completely different, I may be able to give you that too (my ability is limited by my knowledge (as is everyone's)) I'd charge £5,000 - £6,000 for a full-fledged system with ease-of-use and ease-of-modification (and that includes the rights to the code..)
  9. Right, there is a way to fix that, but that means grabbing a local copy of the jQuery lib. Also, that's not what's causing the issue.. If you'd like, I'll take a look and see what I can find.
  10. If you're using Firefox/Chrome, please enable the console and reload the page. Paste any error messages please
  11. I would highly recommend using an SFTP program - FileZilla is completely free and will have everything you need :)
  12. So, yeah, gang ranks.. I made a gang ranks module for DRCity (when it was still running) and, now that I have no use for it, I'm releasing it.. Here's the repo: https://bitbucket.org/Magictallguy/mc-codes-gang-ranks Knock yourselves out! Any issues, either post here and post a bug on the issue tracking (registration not required) Note: This one will require some coding on your end, but really not that much. You'll need to take a look at the SQL table to understand what needs to go where
  13. Snippet updated, code tested, fully working - - - Updated - - -   There's a minor issue that I didn't notice until now - please use the updated snippet
  14. Right, I'm gonna upload a copy and do some testing on my private test rig.. Bear with me
  15. Try this: Code moved to snippet My guess is that you don't have the correct functions installed on your system - namely mny_stripfmt() Feckin' MWG's syntax highlighter is whacking extra spacing in where it shouldn't.. I'll whack up a snippet for you... https://bitbucket.org/snippets/Magictallguy/p7rx
  16. Correctly converted and sent to your inbox (as you messaged me with it too -.-)   <?php require_once "globals.php"; if (!$_GET['spend']) { print "Welcome to the Honor Award Exchange Center! You have <b>{$ir['honor']}</b> Honor Awards. What would you like to spend your Honor Awards on? <a href='HonorExchange.php?spend=IQ'>IQ - 100 IQ per Honor Award</a> <a href='HonorExchange.php?spend=labour3'>Trade for Labour Points - 3,000 Labour Points per Honor Award</a> <a href='HonorExchange.php?spend=guard3'>Trade for Defense - 3,000 Defense per Honor Award</a> <a href='HonorExchange.php?spend=agility3'>Trade for Agility - 3,000 Speed per Honor Award</a> <a href='HonorExchange.php?spend=strength3'>Trade for Strength - 3,000 strength per Honor Award</a> <a href='HonorExchange.php?spend=money'>Money - \$2,000,000 per Honor Award</a>"; } else if ($_GET['spend'] == 'IQ') { print "Type in the amount of Honor Awards you want to swap for IQ.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = 100 IQ.<form action='HonorExchange.php?spend=IQ2' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'IQ2') { $_POST['honor'] = (int) $_POST['honor']; if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form<br /><a href='HonorExchange.php?spend=IQ'>Back</a>"; } else { $iqgain = $_POST['honor'] * 100; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor']); $_POST['honor'] = abs((int) ($_POST['honor'])); $db->query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid", $c); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for $iqgain IQ."; } } else if ($_GET['spend'] == 'labour3') { print "Type in the amount of Honor Awards you want to swap for labour points.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = 300,000 labour points.<form action='HonorExchange.php?spend=labour4' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'labour4') { $_POST['honor'] = (int) $_POST['honor']; if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /><a href='HonorExchange.php?spend=labour3'>Back</a>"; } else { $labourgain = $_POST['honor'] * 3000; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); $db->query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid", $c); $db->query("UPDATE userstats SET labour=labour+$labourgain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for $labourgain labour points."; } } else if ($_GET['spend'] == 'guard3') { print "Type in the amount of Honor Awards you want to swap for Defense.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = 3,000 Defense.<form action='HonorExchange.php?spend=guard4' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'guard4') { $_POST['honor'] = (int) $_POST['honor']; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /><a href='HonorExchange.php?spend=guard3'>Back</a>"; } else { $guardgain = $_POST['honor'] * 3000; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); $db->query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid", $c); $db->query("UPDATE userstats SET guard=guard+$guardgain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for $guardgain Defense."; } } else if ($_GET['spend'] == 'agility3') { print "Type in the amount of Honor Awards you want to swap for Agility.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = 3,000 Agility.<form action='HonorExchange.php?spend=agility4' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'agility4') { $_POST['honor'] = (int) $_POST['honor']; if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /><a href='HonorExchange.php?spend=agility3'>Back</a>"; } else { $agilitygain = $_POST['honor'] * 3000; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); $db->query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid", $c); $db->query("UPDATE userstats SET agility=agility+$agilitygain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for $agilitygain Agility."; } } else if ($_GET['spend'] == 'strength3') { print "Type in the amount of Honor Awards you want to swap for Strength.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = 3,000 Strength.<form action='HonorExchange.php?spend=strength4' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'strength4') { $_POST['honor'] = (int) $_POST['honor']; if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /><a href='HonorExchange.php?spend=strength3'>Back</a>"; } else { $strengthgain = $_POST['honor'] * 3000; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); $db->query("UPDATE users SET honor=honor-{$_POST['honor']} WHERE userid=$userid", $c); $db->query("UPDATE userstats SET strength=strength+$strengthgain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for $strengthgain Strength."; } } else if ($_GET['spend'] == 'money') { print "Type in the amount of Honor Awards you want to swap for \$\$\$.<br />You have <b>{$ir['honor']}</b> Honor Awards.<br />One Honor Award = \$2,000,000.<form action='HonorExchange.php?spend=money2' method='post'><input type='text' name='honor' /><input type='submit' value='Swap' /></form>"; } else if ($_GET['spend'] == 'money2') { $_POST['honor'] = (int) $_POST['honor']; if ($_POST['honor'] <= 0 || $_POST['honor'] > $ir['honor']) { print "Error, you either do not have enough Honor Awards or did not fill out the form.<br /><a href='HonorExchange.php?spend=money'>Back</a>"; } else { $iqgain = $_POST['honor'] * 2000000; $_POST['honor'] = strip_tags($_POST['honor']); $_POST['honor'] = mny_stripfmt($_POST['honor'], ENT_QUOTES); $_POST['honor'] = abs((int) ($_POST['honor'])); $_POST['money'] = strip_tags($_POST['money']); $_POST['money'] = mny_stripfmt($_POST['money'], ENT_QUOTES); $_POST['money'] = abs($_POST['money']); $db->query("UPDATE users SET honor=honor-{$_POST['honor']},money=money+$iqgain WHERE userid=$userid", $c); print "You traded {$_POST['honor']} Honor Awards for \$$iqgain."; } } $h->endpage();
  17. A basic wiki for this can now be found here I'll update as I figure out more information about it :)
  18. Aye, I've managed to debug!   Make sure you're using the MySQLi class that MC Craps v2 comes with Edit config.php, find the 'driver' part and change 'mysql' to 'mysqli' MC Craps <= v2.0.2 doesn't come with a MySQLi version of the escape() function, simply add the code below to above the final closing curly brace }   function escape($str) { return mysqli_real_escape_string($this->connection_id, $str); }
  19. Working on it ;)
  20. To anyone having issues with the archive extraction (Linux users mostly) It's a zip within a zip. But the zipception doesn't have an extension. Rename the extracted archive to "chat.zip" and extract as normal
  21. I love you and want your code babies *as the White Chicks* That. Is. So. Sexy..
  22. It's supposed to return blank, nothing is being printed to the user. Also, make sure your cron is setup to use the correct path (and code). Normally something like: * * * * 0 curl yoursite.tld/path/to/lottery_cron.php?code=THE_CODE_FROM_YOUR_CONFIG.PHP_FILE Note: it could do with converting to v2 I'll do the cron file for you. You may wish to use this topic to help you if you're not sure on how to do it lottery_cron.php <?php include "./config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } 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; include "./global_func.php"; $lotteryDetails = $db->query("SELECT * FROM lotteryDetails"); $ld = $db->fetch_row($lotteryDetails); $winNumbers = array(); for($i = 0; $i < 6; $i++) { $num = mt_rand(1, 46); if(empty($winNumbers)) array_push($winNumbers, $num); else { while(in_array($num, $winNumbers)) $num = mt_rand(1, 46); array_push($winNumbers, $num); } } sort($winNumbers); $wn = implode(",", $winNumbers); $getTickets = $db->query("SELECT * FROM lotterytickets"); $jackpot = $db->num_rows($getTickets) * $ld['lotprice'] + $ld['lotjackpot']; $zero = 0; $one = 0; $two = 0; $three = 0; $four = 0; $five = 0; $six = 0; $users = array(); while($gt = $db->fetch_row($getTickets)) { $yourNumbers = explode(",", $gt['numbers']); sort($yourNumbers); if(empty($users)) array_push($users, $gt['userid']); else { if(!in_array($gt['userid'], $users)) array_push($users, $gt['userid']); } $correct = 0; foreach($yourNumbers as $yn) if(in_array($yn, $winNumbers)) ++$correct; if($correct == 0) ++$zero; if($correct == 1) ++$one; if($correct == 2) ++$two; if($correct == 3) ++$three; if($correct == 4) ++$four; if($correct == 5) ++$five; if($correct == 6) ++$six; $db->query("UPDATE lotterytickets SET correct = " . $correct . " WHERE id = " . $gt['id']); } $potWin = array(); $countUsers = count($users); if(!empty($users)) { for($ui = 0; $ui < $countUsers; $ui++) { $selectCorrect = $db->query("SELECT correct, id, userid, numbers FROM lotterytickets WHERE userid = " . $users[$ui]); $event = "<b><u>The winning numbers are: " . $wn . ".</u></b><br />"; $event .= "The results from your " . abs(@intval($db->num_rows($selectCorrect))) . " lottery tickets:<br />"; $nowin = array( 0, 1, 2 ); $total = 0; while($sc = $db->fetch_row($selectCorrect)) { $event .= "<b>Ticket numbers: " . $sc['numbers'] . "</b>"; if(in_array($sc['correct'], $nowin)) $event .= "<i> -- " . $sc['correct'] . " matching number(s) (no winnings)</i>"; else { if($sc['correct'] == 3) $winnings = $ld['lotprice'] + floor($ld['lotprice'] * 0.5); if($sc['correct'] == 4) $winnings = $ld['lotprice'] + floor($ld['lotprice'] * 0.8); if($sc['correct'] == 5) $winnings = $ld['lotprice'] + floor($ld['lotprice'] * 1.4); if($sc['correct'] == 6) { $winnings = $ld['lotprice'] + floor($jackpot / $six); array_push($potWin, $users[$ui]); } $event .= "<i> -- " . $sc['correct'] . " matching numbers (Won \$" . number_format($winnings) . ")</i>"; $total += $winnings; } } $event .= "You won a total of \$" . number_format($total) . ".<hr />"; event_add($users[$ui], trim($event)); $db->query("UPDATE users SET money = money + " . $total . " WHERE userid = " . $users[$ui]); } $winners = !empty($potWin) ? implode(",", $potWin) : 'N/A'; $db->query("INSERT INTO lotterydone (ldID, ldNUMBERS, ldZERO, ldONE, ldTWO, ldTHREE, ldFOUR, ldFIVE, ldSIX, ldPOT, ldPOTWIN, ldTIME) VALUES('','" . $wn . "', " . $zero . ", " . $one . ", " . $two . ", " . $three . ", " . $four . ", " . $five . ", " . $six . ", " . $jackpot . ", '" . $winners . "', UNIX_TIMESTAMP())"); $jp = !$six ? $jackpot : 0; $db->query("UPDATE lotteryDetails SET lotjackpot = " . $jp); } else event_add(1, "No lottery this week. :("); $db->query("TRUNCATE TABLE lotterytickets");
  23. Not compatible (OOTB anyway) with Dave's chat
×
×
  • Create New...