Jump to content

NonStopCoding

Members
  • Content Count

    572
  • Joined

  • Last visited

  • Days Won

    7

NonStopCoding last won the day on November 5 2016

NonStopCoding had the most liked content!

Community Reputation

20 Excellent

About NonStopCoding

  • Rank
    Trainee
  • Birthday 12/19/1989

Personal Information

  • Location
    Dundee
  • Interests
    Html,Css,Php,mysql
  • Occupation
    Web Developer
  • Website
    http://thegrpg-project.com

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I said that to him too but he did not want anyone to have access it to which i can understand and i said to him that it doesnt matter if its public none knows where he was going with the idea plus it was missing 2 key features he requested which none had access or knows about but hey its done now lol
  2. There was no payment made for this project and i have removed it and deleted it of my pc so its gone for good i have to much rl issues going on to be dealing with this. I never got paid for my code so i figured it was best to be released where someone could of had better use of it. But now its gone so lets all just get on with out lives.
  3. Nope it does not and i have made alterations to make sure that the users data is a number which we are expecting if you have any suggestions for improvements feel free to fire away always open to criticism (good or bad) Yea i think so but when i took on the project the client did not request a time frame for completion i spent a while trying to get his credits module done by Arson i think to work but had no luck then he messaged me saying if any of them were not completed by today then he would have to go with someone else. So i just released what i had done for anyone to use / build upon / convert up to them :).
  4. NonStopCoding

    Hey hey

    The noise you added into the backgrounds for the boxes etc it just don't look right with my eyes thats just my opinion other people might like it :)
  5. Removed due to got to much rl issues to be dealing with this.
  6. NonStopCoding

    Hey hey

    I liked the design upon until i logged into the game good luck with your project and welcome back :)
  7. Nice find thanks for the share :)
  8. GL is good but i think you would be better learning with something a little easier like mccodes? you wont be launching a game anytime soon due to learning so might as well get the feel for the right engine for you
  9. Thanks for clearing that up mtg and hey Kyle been a long time :p
  10. * Fixed some minor issues in code * This is my most recent module decided to release it for free hope you enjoy. Okay so first off the sql files. CREATE TABLE IF NOT EXISTS `drugs` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(75) NOT NULL, `cost` int(11) NOT NULL, `buyable` enum('yes', 'no') NOT NULL DEFAULT 'yes', `drugtype` int(11) NOT NULL, `specialeffect` enum('yes', 'no') NOT NULL DEFAULT 'no', `effectid` int(11) NOT NULL DEFAULT '0' ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `drugtypes` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(75) NOT NULL ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `drugeffects` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `drugid` int(11) NOT NULL, `strengthoption` enum('', '+', '-') NOT NULL DEFAULT '', `strengh` int(11) NOT NULL DEFAULT '0', `defenseoption` enum('', '+', '-') NOT NULL DEFAULT '', `defense` int(11) NOT NULL DEFAULT '0', `speedoption` enum('', '+', '-') NOT NULL DEFAULT '', `speed` int(11) NOT NULL DEFAULT '0', `awakeoption` enum('', '+', '-') NOT NULL DEFAULT '', `awake` int(11) NOT NULL DEFAULT '0', `nerveoption` enum('', '+', '-') NOT NULL DEFAULT '', `nerve` int(11) NOT NULL DEFAULT '0' ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `drugmarket` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `drug` int(11) NOT NULL, `cost` int(11) NOT NULL, `oldcost` int(11) NOT NULL, `qty` int(11) NOT NULL ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `drugevents` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `eventname` varchar(75) NOT NULL, `eventamount` int(11) NOT NULL, `eventcost` int(11) NOT NULL, `eventstart` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `eventlasting` int(3) NOT NULL ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `userdrugs` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` int(11) NOT NULL, `drug` int(11) NOT NULL, `qty` int(11) NOT NULL ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `drugbuildings` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(75) NOT NULL, `cost` int(11) NOT NULL, `drug` int(11) NOT NULL, `baseproduction` decimal(11, 3) NOT NULL, `purchaseable` enum('yes', 'no') NOT NULL ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `userdrugbuildings` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` int(11) NOT NULL, `building` int(11) NOT NULL, `produced` decimal(11, 3) NOT NULL DEFAULT '0.000' ) ENGINE = INNODB; CREATE TABLE IF NOT EXISTS `druglogs` ( `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `type` enum('drugpurchase', 'buildingpurchase', 'drugselling', 'drugbuying', '') NOT NULL DEFAULT '', `text` varchar(255) NOT NULL, `user` int(11) NOT NULL, `building` int(11) NOT NULL DEFAULT '0', `drug` int(11) NOT NULL DEFAULT '0', `amountgained` int(11) NOT NULL DEFAULT '0', `amountsold` int(11) NOT NULL DEFAULT '0', `timedone` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = INNODB; now create a file called drugmarket.php and insert this code <?php require_once __DIR__.'/inc/header.php'; $_POST['id'] = array_key_exists('id', $_POST) && ctype_digit($_POST['id']) ? abs(intval($_POST['id'])) : null; ?> <script type="text/javascript"> $(document).ready(function() { $("#display").click(function() { $.ajax({ //create an ajax request to load_page.php type: "POST", url: "drugmarket.php", dataType: "html", //expect html to be returned success: function(response) { $("#responsecontainer").html(response); //alert(response); } }); }); }); </script> <tr><td class='content-head'>Drug Market</td></tr> <div id='responsecontainer'> <?php if (array_key_exists('buy', $_POST)) { if (!csrf_check('csrf', $_POST)) { echo Message(SECURITY_TIMEOUT_MESSAGE); } if (empty($_GET['id'])) { echo Message('Invalid drug found!.', 'Error', true); } $_POST['amt'] = array_key_exists('amt', $_POST) && ctype_digit($_POST['amt']) && $_POST['amt'] > 0 ? $_POST['amt'] : null; if (empty($_POST['amt'])) { echo Message('Invalid amount!.', 'Error', true); } $db->query('SELECT * FROM drugmarket INNER JOIN `drugs` WHERE (drug = id) AND id = ?'); $db->execute([$_POST['id']]); if (!$db->count()) { echo Message('Could not find a drug by this id please try again or contact staff if keeps happining!.', 'Error', true); } $drug = $db->fetch(true); if ($drug['cost'] * $_POST['amt'] > $user_class->money) { echo Message('You do not have enough money for [X'.format($_POST['amt']).'] '.format($drug['name']).'', 'Error', true); } if ($_POST['amt'] > $drug['qty']) { echo Message('There is not enough of this drug!.', 'Error', true); } if (!$drug['qty']) { echo Message('There is none of this stock left!.', 'Error', true); } $totalcost = $drug['cost'] * $_POST['amt']; $db->trans('stat'); $db->query('UPDATE users SET money = GREATEST(money - ?, 0) WHERE id = ?'); $db->execute([$totalcost, $user_class->id]); $db->query('INSERT INTO userdrugs (user, drug, qty) VALUES (?, ?, ?)'); $db->execute($user_class->id, $drug['drug'], $_POST['amt']); $db->query('UPDATE drugmarket SET qty = GREATEST(qty - ?, 0) WHERE id = ?'); $db->execute([$_POST['id']]); $db->trans('end'); echo Message('You have purchased [X'.format($_POST['amt']).'] of '.format($drug['name']).' for '.prettynum($totalcost, true).'', null, false); } ?> </div> <tr><td class='content'> <table width='98%' cellspacing='1' style='text-align:center;'> <tr> <th>Drug</th> <th>Cost</th> <th>Qty</th> <th>Action</th> </tr> <?php $db->query('SELECT dm.*, d.name FROM drugmarket AS dm INNER JOIN drugs AS d ON d.id = dm.drug ORDER BY cost, qty ASC'); $db->execute(); $rows = $db->fetch(); if (!$rows) { ?> <tr><td colspan='4'>There are no drugs on the market!.</td></tr> <?php } foreach ($rows as $r) { $greaterorless = $r['cost'] < $r['oldcost'] ? 'red' : 'green'; $stalemate = $r['cost'] == $r['oldcost'] ? '' : $greaterorless; ?> <tr> <td><?php echo format($r['name']); ?></td> <td><span style='color:<?php echo $stalemate; ?>;'><?php echo prettynum($r['cost'], true); ?></span></td> <td><?php echo format($r['qty']); ?></td> <td> <form method='post'> <input type='hidden' name='id' value='<?php echo $r['id']; ?>' /> Qty: <input type='number' name='amt' min='1' value='0' /> <input type='submit' name='buy' id='display' value='[Buy]' /> </form> </td> </tr> <?php } ?> </table> </td></tr> Will be adding new features to this soon any issues or bugs let me know. oh almost forgot you need a js library for the ajax to work <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  11. Yea stock market was a big issue with old grpg script back in the day there is another issue within the files but can't remember exactly which file it was but you could edit the value using inspect and buy more points (might of been point market or something along the lines of that) just in case you missed it.
  12. Only had 10 shares * You need to get that stock market secured properly mate could cause big problems at launch * also your text on the inputs is white which is bad due to the input box being white * You can buy items from other shops by editing id in url was in store.php You have purchased a Padded Shirt You have sold 10100 shares for a total of $718110 ($79 per share X 10100 shares - $79790 transaction fee) You have sold 19999999 shares for a total of $7.200018719999E+14 ($40000106 per share X 19999999 shares - $80000207999990 transaction fee)
  13. Some minor changes and a missed mysql_query fix <?php /* Module Name: Lucky Dip * Module Version: v2.00 * Module Price: $0.00 * Recoded for GRPG v2 * Originally created for GRPG v1 by NonStopCoding */ require_once __DIR__.'/inc/header.php'; if (array_key_exists('tryluck', $_POST)) { if ($user_class->money < 10000) { echo Message('You don\'t have enough money to buy a jackpot dip.', 'Error', true); } if (!$user_class->lucky) { echo Message('You have already done your lucky dip today.', 'Error', true); } $money = mt_rand(0, 20000); $points = mt_rand(0, 5); $special = mt_rand(1, 350); $newm = $user_class->money + $money; $newp = $user_class->points + $points; if ($special == 10) { $money = mt_rand(0,20000); $points = mt_rand(0,5); $money = $money * 2; $points = $points * 2; $newm = $user_class->money + $money; $newp = $user_class->points + $points; $db->query('UPDATE users SET money = GREATEST(money - 10000, 0) WHERE id = ?'); $db->execute([$user_class->id]); echo Message('Woa your really lucky today and doubled your gain.<br /> You gained '.format($points).' point'.s($points).' and '.prettynum($money, true).'', null, false); $db->query('UPDATE users SET money = ?, points = ?, lucky = 0 WHERE id = ?'); $db->execute([$newm, $newp, $user_class->id]); } else { echo Message('You gained '.format($points).' point'.s($points).' and '.prettynum($money, true), null, false); $db->query('UPDATE users SET money = ?, points = ?, lucky = 0 WHERE id = ?'); $db->execute([$newm, $newp, $user_class->id]); $db->query('UPDATE users SET money = GREATEST(money - 10000, 0) WHERE id = ?'); $db->execute([$user_class->id]); } ?> <tr><td class="content-head">Lucky Dip</td></tr> <tr><td class="content"> <i>So are you feeling lucky?? well for $10.000 you can take a shot at the luck dip.</i><br /> <i>You can win up to x2 the ticket prize and if your super lucky you can double that but only if your really lucky.</i><br /> <form method="post"> <input type="submit" name="tryluck" value="Try My Luck" /> </form> </td></tr>
×
×
  • Create New...