Jump to content
MakeWebGames

Diesl

Members
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Diesl

  1. use $amount=mysql_real_escape_string($_POST['amount']); or $amount=$db->escape($_POST['amount']); what you used doesn't exist.
  2. when you use the curl, you have to make sure you include the ?code= at the end. The code will be in your config.php file So in the end you will have curl http://mafiasfinest.com/lotterycron.php?code=addcodehere otherwise nothing will run, due to the code on line 4: if($_GET['code'] != $_CONFIG['code']) { die(""); } You can comment that line out for testing purposes, but make sure you add in the previous bit to the curl.
  3. Diesl

    Attack.php

    You could add some sort of restriction that a player can not be attacked unless they have at least 33%, 50%, etc, health. Something such as: if($playerb['health'] < ($playerb['maxhealth']*0.5)) //0.5 for 50% health { die("message"); }
  4. I believe it's $ir['new_events'] Take what Equinox wrote and add it to your header, or wherever you are displaying the Events link on your interface.
  5. Looks like a basic craft system. Useful to users who want it. Feedback: Since there is no demo, and all I can go off is screenshots, you may want to include on your "Create Item" page what is needed to actually make the item. A set of requirements in another column, or written underneath the item. Also, if someone is missing some of the requirements to make the item, when they get the response back from the game it should say which requirements are missing and how many. Feedback for you: No need to insult people who are trying to find out more about your mod.
  6. Looks good. Just a quick tip: Make sure that the edges of your layout are aligned, so that it can be visually satisfying. With your design, the left edge of the User info box should align with the left edge of the page text context box, and the same thing with the right edge.
  7. From a shitty student residence in Geneva, Switzerland
  8. Do you any examples of game banners, ads or any graphic work that you've designed? So far you just posted up basic buttons or logos.. not so much graphic banners. As a designer myself, I have to say they are quite bland.
  9. Post your entire code please. The code should work. You are either: a) using the code incorrectly b) using or reading the `level` field in your database incorrectly
  10. You need the SQL query to create a table. Google "MYSQL create table". Once you've got the command.. create a table called orgcrimes. If you have phpmyadmin you can do it manually by creating that table in your database.  You should learn how to do this on your own, or you will never learn how to code your own SQL statements in your game.
  11. That was the point. There are many instances where I would require users to have more than 1 of that item, and thus need to check accordingly. If you just had the function check only for 1, then you are limiting yourself. However, you could also modify the function call to have function item_have($user, $item, $qty=1) [~EDITED~], which will look for 1 item by default. Thank you to all for the input.
  12. Here are a list of useful functions that I've used. You might find them useful as well. Please add your own sanitize/security functions where you see fit. - This function checks if the user has a specific item in their inventory. It will return true if they do and false if they don't. Requires you to enter in the users ID, the item ID and the quantity of items you want to check. function item_have($user, $item, $qty) //checks if the user has the item in their inventory { global $db; $item=$db->query("SELECT inv_itemid FROM inventory WHERE inv_userid=$user AND inv_itemid=$item AND inv_qty>=$qty"); if($db->num_rows($item) < 1) { return false; } else { return true; } }   - This function will return the name of the city that the user is currently in. Requires you to input the users location ID from the users table. function location($location) //returns the city name { global $db; $cityname=$db->query("SELECT cityname FROM cities WHERE cityid=$location"); $cn=$db->fetch_row($cityname); return ($cn['cityname']); }   - This function will return a suffix of "s" if the qty entered is more than one. This is useful when you are displaying how much of a certain item a player has earned. function suffix($qty) //adds a suffix of "s" if qty is more than 1 { $s = ""; if($qty > 1) { $s = "s"; } return $s; }   - This function will return time formatted so that it shows how much time has passed from the inputted time until the current time (similar to how time is shown on facebook or twitter posts). Requires you to input the unformatted Unix time. I grabbed this code from a development blog and modified it to suit my needs. After 7 days, the time will show the formatted date instead of the "how long ago" format. function time_since($original) { // array of time period chunks $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * 24 * 30 , 'month'), array(60 * 60 * 24 * 7, 'week'), array(60 * 60 * 24 , 'day'), array(60 * 60 , 'hour'), array(60 , 'minute'), array(1 , 'second'), ); $today = time(); /* Current unix time */ $since = $today - $original; if($since > 604800) { $print = date("M jS", $original); if($since > 31536000) { $print .= ", " . date("Y", $original); } return $print; } // $j saves performing the count function each time around the loop for ($i = 0, $j = count($chunks); $i < $j; $i++) { $seconds = $chunks[$i][0]; $name = $chunks[$i][1]; // finding the biggest chunk (if the chunk fits, break) if (($count = floor($since / $seconds)) != 0) { break; } } $print = ($count == 1) ? '1 '.$name : "$count {$name}s"; return $print . " ago"; }
  13. You can not really tell unless you see the technical specs of the server itself. However, think of where your main user base will be coming from. I noticed that the hosting company is in pakistan. If you're main user base is coming from North America, it will take a longer time for these users to load a page since any data has to travel a longer distance for them.
  14. Diesl

    Optimism

    Mostly true, but not always.   - Try to stay away from nested loops (especially with query's inside them). They might seem harmless at first, but they can unknowingly grow and take up quite a bit of resource usage. - Try to keep the page size as small as you can. Use global functions to perform repetitive tasks.
  15. It looks very clean and very well styled. The mailbox page you are showing is very well done and quite user friendly. However, what is the theme of your website? The design is very similar to that of a personal portfolio or blog. It doesn't really capture any theme at all. You might want to think about incorporating some visual elements that relate to the theme of your game. Also there is quite a bit of whitespace at the top. For a player on a laptop or mobile device, they will have to scroll a bit more than necessary just to get at your main content. I might try to utilize the top of the interface a bit better.
  16. Just a little optimization note. When you are doing a SELECT, only grab the columns that you need, not all. It will decrease the time needed for a database query. You won't much of a difference if you are pulling up a few rows, but once you get into the hundreds, and possibly add on a few more columns, you will notice a difference. ex. use ---> SELECT imQTY FROM itemmarket ......... instead of --> SELECT * FROM itemmarket
  17. Besides internet explorer, most popular browsers will display your game exactly how you see it. Internet Explorer has some different CSS standards which could mess up how your code renders. The best thing to do, as spudinski said is to use the correct web standards. Run your page through the w3c validator (google it) and/or download the popular browser clients (Firefox, IE, chrome, safari) onto your computer and view your site in each one.
  18. Diesl

    Include "...."

    Just wondering, why are people using include(DIRNAME(__FILE__) . '/whateverpage.php');   instead of the default include "whateverpage.php";   ? I've seen it on a quite a few mods and I'm not sure of its reasoning.
  19. Yea it has been done before, but as you said, not using AJAX.
  20. It would depend how you structure your game. If you make it easy to get stats, than a percentage would work, but if it's hard to get stats, i would you a set amount and a percentage. ex. stat - (100 + (1 % of stat))
  21. He means you have no function called game_staff()
  22. Use this in before the "echo date...." line date_default_timezone_set('Australia/Brisbane'); more info: http://php.net/manual/en/function.date-default-timezone-set.php
  23. Just a couple of restriction suggestions - Gangs should only be able to have 1 NPC join their gang at a time. - Gangs currently in a war should not have an NPC in their gang. Just IMO.
  24. Is the NPC automatically made to join the gang or does the gang president have to invite a random NPC into the gang? And let me see if i get this straight NPC joins gang --> starts attacking members --> gang fights back against NPC if you beat the NPC --> gang gets rewards, NPC can stay in gang if you fail to beat the NPC (how is this done by the way? all gang members are in the hopsital?) --> all gang members in hospital and president held hostage until reward frees him --> Rinse and repeat Sounds interesting.
  25. Just a quick note to help anyone who had the same problem as me. If you used the @getimagesize() function and you sure you were correct with the coding, but any picture you uploaded (or are uploading if used in preferences.php) never returned properly, you may have to enable allow_url_fopen in your php.ini. No matter what,any picture I was uploading, it always evaluated to false which would show an error to the user. Changing the allow_url_fopen to "on" made it work.
×
×
  • Create New...