Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Add this in your hospital page - $healcost = $r['level'] * 500; $cf = money_formatter($healcost); echo "[<a href='hospitalheal.php?ID={$r['userid']}'>Heal for {$healcost}</a>]"; create hospitalheal.php <?php define('PAGE_HEADER', 'Hospital: Heal'); require_once('globals.php'); echo "<h3><u>Hospital: Heal</u></h3>"; if ($ir['hopsital']) { echo "You cannot heal while in hospital."; exit($h->endpage()); } $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : 0; $hospital_q = $db->query( "SELECT `userid`, `hospital`, `level`, `username` FROM `users` WHERE `userid` = {$_GET['ID']}"); if ($db->num_rows($hospital_q) == 0) { $db->free_result($hospital_q); echo "Invalid user."; exit($h->endpage()); } $r = $db->fetch_row($hospital_q); $db->free_result($hospital_q); if (!$r['hospital']) { echo "That user is not in hospital!"; exit($h->endpage()); } $cost = $r['level'] * 500; $cf = money_formatter($r['level'] * 500); if ($ir['money'] < $cost) { echo "Sorry, you do not have enough money to heal out {$r['username']}. You need {$cf}."; } echo "You successfully healed {$r['username']} out of hospital for {$cf}."; $db->query( "UPDATE `users` SET `money` = `money` - {$cost} WHERE `userid` = $userid"); $db->query( "UPDATE `users` SET `hospital` = 0 WHERE `userid` = {$r['userid']}"); event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> healed you out of hospital.", $c); $h->endpage(); ?> Hope this helps.
  3. Today
  4. Hello, from the help of @Magictallguy. THANK YOU!I have finally created two drop down lists which show the make and model of the vehicles from the database. However, know when I choose the make on the first drop down list I want it dynamically to show the second drop down list only specific for the make which has been chosen! However, I seem to be getting this wrong. If someone could help me out here would be appreciated search.php - <!DOCTYPE HTML> <head> <title>Car Search</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('#cmMAKE').on('change', function(){ var cmMAKE = $(this).val(); if(cmMAKE){ $.ajax({ type:'POST', url:'searchAjax.php', data:'cmMAKE='+cmMAKE, success:function(html){ $('#cmMAKE').html(html); $('#cmMODEL').html('<option value="">Select make first</option>'); } }); }else{ $('#cmMAKE').html('<option value="">Select make first</option>'); $('#cmMODEL').html('<option value="">Select model first</option>'); } }); </script> </head> <?php error_reporting(E_ALL & ~E_NOTICE); require("config/config.php"); try { $database = new Connection(); $db = $database->openConnection(); $q = $db->prepare("SELECT COUNT(`avail`.`cID`) AS `total`, `make`.`cmMAKE` FROM `cars_available` AS `avail` INNER JOIN `car_makes` AS `make` ON `avail`.`cMAKE` = `make`.`cmID` GROUP BY `avail`.`cMAKE` ORDER BY `total` DESC, `make`.`cmMAKE` ASC"); $q->execute(); $data = $q->fetchAll(); ?> <table width = "50%"> <tr> <th><h3>SEARCH OUR CARS</h3></th> <th><h4>Make:</h4></th> <!-- <form name="searchcars" method="POST" action="searchsubmit.php"> --> <th> <select name="cmMAKE" id="cmMAKE"> <option value="">MAKE</option> <?php foreach ($data as $row): ?> <option><?=$row["cmMAKE"]?> (<?=$row["total"]?>)</option> <?php endforeach ?> </select> </th> <?php $q2 = $db->prepare("SELECT COUNT(`avail`.`cMODEL`) AS `total`, `model`.`cmoMODEL` FROM `cars_available` AS `avail` INNER JOIN `car_models` AS `model` ON `avail`.`cMODEL` = `model`.`cmoID` GROUP BY `avail`.`cMODEL` ORDER BY `total` DESC, `model`.`cmoMODEL` ASC"); $q2->execute(); $data2 = $q2->fetchAll(); ?> <th><h4>Model:</h4></th> <th> <select name="cmoMODEL" id="cmoMODEL"> <option value="">MODEL</option> <?php foreach ($data2 as $row2): ?> <option><?=$row2["cmoMODEL"]?> (<?=$row2["total"]?>)</option> <?php endforeach ?> </select> </th> <th><input type="submit" value="Submit"></th> </form> </tr> <table> <?php $database->closeConnection(); } catch (PDOException $e) { echo "There is some problem in connection: " . $e->getMessage(); } ?> </html> searchAjax.php - <?php error_reporting(E_ALL & ~E_NOTICE); require("config/config.php"); $cmMAKE = $_POST["cmMAKE"]; try { $database = new Connection(); $db = $database->openConnection(); if(!empty($_POST["cmMAKE"])) { // Fetch model data based on the specific make $q2 = $db->prepare("SELECT COUNT(`avail`.`cMODEL`) AS `total`, `model`.`cmoMODEL` FROM `cars_available` AS `avail` INNER JOIN `car_models` AS `model` ON `avail`.`cMODEL` = :cmMAKE GROUP BY `avail`.`cMODEL` ORDER BY `total` DESC, `model`.`cmoMODEL` ASC"); $q2->bindParam(":cmMAKE", $cmMAKE); $q2->execute(); $data2 = $q2->fetchAll(); ?> //$query = "SELECT * FROM states WHERE country_id = ".$_POST['country_id']." AND status = 1 ORDER BY state_name ASC"; //$result = $db->query($query); > // Generate HTML of state options list <?php foreach ($data as $row): ?> <option><?=$data2["cmoMODEL"]?> (<?=$row["total"]?>)</option> <?php endforeach ?> <? } $database->closeConnection(); } catch (PDOException $e) { echo "There is some problem in connection: " . $e->getMessage(); } ?>
  5. Yesterday
  6. Welcome back! Let me know if you need anything.
  7. I'll plus 1 MTG on that one, just make sure before you launch you have a very good game idea and also a marketing strategy in place
  8. Welcome back! There is indeed still a market for text-based games
  9. Hi, I used to spend a lot of time of this forum years ago when I was in school and college and it's what got me into programming. I'm now a software engineer. I mainly use Javascript, React, Java, Node, Postgres etc.. It's great to see the forum back up. I mainly read posts and played around with Mccodes. Is there still a market for text based games?
  10. S'pose I can spare the time 😛 MCC Lite, aye?
  11. Last week
  12. So would you be volunteering to help me then 🙂 cant blame me for asking :P
  13. Not to my knowledge, but one can be created for you
  14. I don't have the code anymore.
  15. Been looking for a couple days now hard to find exactly what I'm looking for. Is there a hospital mod for allowing people to either heal themselves or others out of the hospital for cash or crystals? Thanks for helping in advance. And sorry if I posted this in the wrong spot.
  16. Can you clear anything up for us, @sniko?
  17. Now on to the next 🙂 thanks
  18. Happy to help, glad to hear you're up and running ^.^
  19. Got it up and running thank you so much for the help I couldn't have figured it out with out your help
  20. Alright, let's try a slightly different method. Replace if ($argc == 2) { if ($argv[1] != $cron_code) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $cron_code) { exit; } with if (isset($argv)) { $args = parse_str($argv[1], $param); $_GET['code'] = $param['code']; } if(!array_key_exists('code', $_GET) or $_GET['code'] != $cron_code) { exit; }
  21. That's how it reads but they dont work
  22. You haven't passed the cron token to your command either. So, the top of your cron file (using the snippet you posted as reference) require_once dirname(__DIR__).'/mysqli.php'; $cron_code = '672bb9f5a0b168da99fbbf74980175ecd'; if ($argc == 2) { if ($argv[1] != $cron_code) { exit; } } else if (!isset($_GET['code']) || $_GET['code'] !== $cron_code) { exit; } And your command should be php /home/battlefo/public_html/crons/cron_fivemins.php code=672bb9f5a0b168da99fbbf74980175ecd
  23. if my dataase is named battlefo_battlefo************* and my line reads like this php /home/battlefo/public_html/crons/cron_fivemins.php in my cornsjob Should it read battlefo_battlefo************ in the code line?
  24. You've passed a cron command to a variable that shouldn't be there. Change your $cron_code var to hold, funnily enough, your cron's code (an override token that allows it to run). $cron_code = '672bb9f5a0b168da99fbbf74980175ecd'; You may also wish to generate a new cron token as that one is now public - note that, if you do, you will need to update the cron commands with the new token too
  25. |SAMZ|

    Looking to buy

    Not much if it's just a backup and for an online game it's all down to user activity. I'm more interested in a base to work with which has useful mods installed preferably mccodes or maybe even GRPG.
  26. adamhull

    Looking to buy

    How much you looking to spend? What genre you looking for?
  27. |SAMZ|

    Looking to buy

    Hey All, Good to see this forum still online! I am looking to buy any type of game online or even if you just have a backup! What do you have and I will make an offer.
  28. thanks i will try that and see what happens still didnt work is there somethingelse i should add?
  1. Load more activity
  • Create New...