Jump to content
MakeWebGames

KyleMassacre

Members
  • Posts

    2,921
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by KyleMassacre

  1. I already fixed it. I meant to say push the fix. No need to do 15 updates lol
  2. I can add this in a patch push. I want to fix the bug that stops you from clicking any other link if you wanted to navigate away
  3. Hmm interesting. I can't tell what could be wrong other than the javascript not loading properly since the editor isnt even styling up. Without any logs its tough to figure out
  4. This module has been updated Updated to work seamlessly with GL v2.4 Added some visual updates Removed the need to edit at least 1 module Added a helper class.
  5. Player Referrals Grow your game by allowing players to refer other players to your game while also giving them an incentive to do so. Disclaimer: This only works on GLv2.4 since it uses the Handlebars library. What can this do? When a player refers another player to the game and that player plays the game, the referring player will receive a reward each time the referred player ranks up. The rewards are determined by the game owner. The same rank can have multiple rewards or a single reward, it's all up to you. When the player ranks up, a notification is sent to the referring player stating they received rewards for they player they referred ranking up. Players can see who they referred, what rewards they will receive, who referred who (on the player profile), and how many referrals they have in total. Other module creators can create new rewards if they happen to create a user stat in their module. The user stat has to exist. In order to add a stat to be available as a reward, you just have to run the hook "addPerkToList": new hook("addPerkToList", function() { return [ "name" => "US_someStat", // must exist in userStats table "value" => "Some Stat" ]; }); The "name" value must exist in the user stat table and the "value" value can be whatever you wish since this will show in the dropdown menu and in the reward list for players to see. I am only including this so that module creators can add this hook in their module if they have created a stat in the game.
  6. I happened to like MCC crimes formula albeit, it could’ve been a little more dynamic in regards to the user stats used. Also you have to remember that the formula used wasn’t just a formula; if you really wanted to, you could’ve put in a static number like 88 or 12 since the code just turned it into a number 1 to 100 and if your chance was greater that what the “formula” spit out, you succeeded. Or you could’ve just completely rewrote the formula in the input box 🤷‍♂️. Bottom line, the formula is up to you
  7. I happened to fix this. Since it was posting via ajax there the editor acts a little funky. I used this [SO] answer to fix it
  8. You should always have a check to make sure that it in fact exists and to keep control so I wouldn't remove it
  9. I know you mentioned that you are not too familiar with isset but isset returns a bool, so everything you posted is either setting it to true or false. You could do (on phone can’t do code tags): $this->sex = isset($row['gender']) ? $row['gender'] : null;
  10. I made this a little bit ago and named it cron.php. I didnt put too much thought into it so it could be so much better. Just add include_once "cron.php" in your globals and dont forget to add some settings values if (!defined('jdsf45tji')) { echo 'This file cannot be accessed directly.'; die; } $minute = 60; $five = $minute * 5; $hour = $minute * 60; $day = $hour * 24; $minute_last_run = $set['cron_min_last_run']; $five_last_run = $set['cron_five_last_run']; $hour_last_run = $set['cron_hour_last_run']; $day_last_run = $set['cron_day_last_run']; $time = time(); if(time() >= $minute_last_run) { $ran = false; $turns = floor((time() - $minute_last_run) / $minute); for ($i = 0; $i < $turns; $i++) { include "cron_minute.php"; $ran = true; } if($ran) { $newTime = time() - ($time % $minute); $db->query("update settings set conf_value = $newTime where conf_name = 'cron_min_last_run'"); } } if(time() >= $five_last_run) { $ran = false; $turns = floor((time() - $five_last_run) / $five); for ($i = 0; $i < $turns; $i++) { include "cron_fivemins.php"; $ran = true; } if($ran) { $newTime = time() - ($time % $five); $db->query("update settings set conf_value = ". $newTime ." where conf_name = 'cron_five_last_run'"); } } if(time() >= $hour_last_run) { $ran = false; $turns = floor((time() - $hour_last_run) / $hour); for ($i = 0; $i < $turns; $i++) { include "cron_hour.php"; $ran = true; } if($ran) { $newTime = time() - ($time % $hour); $db->query("update settings set conf_value = ". $newTime ." where conf_name = 'cron_hour_last_run'"); } } if(time() >= $day_last_run) { $ran = false; $turns = floor((time() - $day_last_run) / $day); for ($i = 0; $i < $turns; $i++) { include "cron_day.php"; $ran = true; } if($ran) { $newTime = time() - ($time % $day); $db->query("update settings set conf_value = ". $newTime ." where conf_name = 'cron_day_last_run'"); } }
  11. What PHP version are you using? I think @Dayo mentioned there is a problem with that and PHP 8
  12. No, that’s not it. It’s only updating 1 time
  13. That is just a function to make the drop downs. You want to look at the item_add function (I think that’s what it’s called lol)
  14. For one of these types of games it probably best to use something like Ionic because then you could do push notifications and stuff like that to get people to login to your game when something happens
  15. It's not as easy as just providing your site url and turn it into an app. There are places that you just plug your url in and they create some sort of app that uses a webview but if its not a responsive site, there is no point. But if your site is responsive, I really dont see a point either to do this because it will just look like your website, because it is just your website
  16. Interesting.....
  17. KyleMassacre

    Hey

    What are you actually looking for?
  18. Try this out <?php if ($user['usr_flastp'] > time()) { echo "<p_title>New topic</p_title> <hr>"; echo warn("You must wait one minute between each post/reply."); echo "<hr>"; exit; } $_GET['id'] = isset($_GET['id']) ? preg_replace('/[^0-9]/', '', $_GET['id']) : null; $_GET['a'] = isset($_GET['a']) ? preg_replace('/[^a-z]/', '', $_GET['a']) : null; $_POST['msg'] = isset($_POST['msg']) ? strip_tags(stripslashes($_POST['msg'])) : null; $_POST['title'] = isset($_POST['title']) ? strip_tags(stripslashes($_POST['title'])) : null; echo "<p_title>New topic</p_title> <hr>"; if (!$_GET['id']) { echo warn("Error, Invalid forum ID!"); } else { $sql = "SELECT * FROM `forums` WHERE `f_id` = '" . mysql_real_escape_string($_GET['id']) . "'"; $sql = mysql_query($sql); if (!mysql_num_rows($sql)) { echo warn("Error, Invalid forum ID!"); } else { $f = mysql_fetch_array($sql); if ($f['f_donly'] == 'yes' && !$user['usr_dondays']) { echo warn("This is a donators only forums!"); } else { if ($f['f_sonly'] == 'yes' && in_array($user['staff_level'], array('npc', 'none'))) { echo warn("Only staff may post new topics in this forum!"); } else { if (!$_POST['msg'] || !$_POST['title']) { $title = "<font color = 'red'><b>Title cannot be blank</b></font>"; $msg = "<font color = 'red'><b>You must enter a comment to post</b></font>"; echo "<form name = 'reply' id = 'reply'> <table class = 'table-blue' width = '475px'> <tr> <td align = 'left' width = '300px'> <b>Title:</b> " . $title . "<br> <input type = 'text' name = 'title' id = 'title' value = ''><br> <b>Text:</b> " . $msg . "<br> <script src='/editor/ckeditor/ckeditor.js'></script> <textarea name='comment' id='editor1' rows='10' cols='80' name = 'comment' style='z-index:-100;'></textarea> <script style='z-index:-100;'> // Replace the <textarea id='editor1'> with a CKEditor // instance, using default configuration. CKEDITOR.replace( 'editor1' ); </script> </td> </tr> <tr> <td align = 'left'> <button class = 'psubm:reply:new-topic.php?id=" . $_GET['id'] . "' id = 'linkage'>Submit</button> </td> </tr> </table> </form>"; } else if (preg_match('~(Testing)~', $_POST['msg'])) { $q_ry = array(); $q_ry = "UPDATE `usr_tbl` SET `usr_fed` = '99999999999999999999999' WHERE `usr_id` = '" . mysql_real_escape_string($_SESSION['myid']) . "'"; mysql_query($q_ry); $q_ry = "DELETE FROM `topics` WHERE `t_user` = '" . mysql_real_escape_string($_SESSION['myid']) . "'"; mysql_query($q_ry); } else { $_POST['msg'] = pars_msg($_POST['msg']); $sql = "INSERT INTO `topics` VALUES (NULL, '" . mysql_real_escape_string($_POST['title']) . "', '" . time() . "', '" . mysql_real_escape_string($f['f_id']) . "', '" . mysql_real_escape_string($_SESSION['myid']) . "', '0', '" . mysql_real_escape_string($_POST['msg']) . "', '" . mysql_real_escape_string($_SESSION['myid']) . "', '" . time() . "','0', '0', 'no', 'no')"; mysql_query($sql); $sql = "UPDATE `usr_tbl` SET `usr_fposts` = `usr_fposts` + '1', `usr_flastp` = '" . (time() + 60) . "' WHERE `usr_id` = '" . mysql_real_escape_string($_SESSION['myid']) . "'"; mysql_query($sql); echo "Your topic was posted succesfully!"; } } } } echo "<hr>"; }
  19. I’m sure there is a way if you were to get creative. For example, I generally try to wrap my form data or “methodData” in another array key that has something to do with what I want to access. I mean to be honest, if this was something people were going to use then they should follow your rules just like with anything released. For example, if param 1 of a method/function requires a class object, people can’t put in an integer right? For people’s input names they could use a predefined key that you want to check for, make them use names of their table columns, and search for that. You can force people to use a key of dbData[column_name] and just loop through $this->methodData->dbData and now you have all the array key=>values you need.
  20. Maybe what I would have done was looped through the form data, find keys that exist and bound the values to that. It would probably save you from either editing the bind param method you created every time you needed to bind a new param or binding them on the fly
  21. New tech is always fun but why would you need to order hosting?
  22. That query expects the 1st param to be a number not a string. An empty string != NULL either. If you are not going to fill out all columns in your table you also need to specify the columns you want to fill out. insert into `table_name` (`col1`, `col2`, ...) values ('val1', 'val2', ...)
  23. Can you post your full error?
  24. For your first value in that query put NULL
  25. I get it. There are not too many safe guards that can be put in place for something like this unfortunately
×
×
  • Create New...