Jump to content
MakeWebGames

CrazyT

Members
  • Posts

    708
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by CrazyT

  1. Re: Allows you to create items that make you go up a level V2   No i wont.. I've saw your post's/topic's around this forum, half of them are just full of crap.
  2. Re: [MC Code v2] Saved Events I see loads of people making functions and putting them into global_func.php.. Why not even make a new php file do a class and then make functions inside them?... <?php class Functions{ public function escape_data($string) { return mysql_real_escape_string(htmlspecialchars($string)); } } $do = new Functions; ?>   Include it to globals.php include_once 'file_name.php'; Global it. global $do; How to use it. $do->escape_data($var);   Yes, it's more code, but why store it into 1 file all the time, the file will be full of stuff already.
  3. Re: help with coding display   Why addslashes?... if($_SERVER['PHP_SELF'] == '/newspaper.php') { include_once 'mainmenu.php'; } else { include_once 'header.php'; }
  4. Re: Allows you to create items that make you go up a level V2 What the hell, why do you post stupid topics like this?
  5. Re: Only Let You Do Something When You Have Done A Course   $check = sprintf("SELECT inv_id FROM inventory WHERE inv_itemid = IN(8021,8022) AND inv_userid = %u",abs(@intval($ir['userid']))); You can just use IN().
  6. Re: Xampp and Mccodes? There's loads of programs like that the simplest one is just AppServ. Google it. Then once installed All you have to do is go to C:\AppServ\www. Then copy files to there, then go to http://localhost/phpmyadmin create a new database done. Then just run installer on mccode. How easy could it be.
  7. Re: Deleting an item? Yes item_add(USERID, ID OF ITEM, ITEM QTY); I think it's the same way for item_remove(); If im right.
  8. Re: Weird problem It could be that, there a donator it put's there color red.
  9. Re: Donator Gym V2   There's quite a few around this forum or just make your own.
  10. Re: Installing V1   Glad to hear. :mrgreen:
  11. Re: [MC-Codes][V2]Thugs (core system) lol @ Zero-Affect. serialize(); unserialize(); strtolower(); strtoupper(); print_r(); empty(); mysql_free_result(); is_array(); strpos(); stripslashes(); strip_tags(); array_combine(); array_merge(); number_format(); foreach(); for(); strtr(); ucfirst(); ucwords(); printf(); sprintf(); strcmp(); preg_match(); preg_replace(); str_replace(); preg_split(); preg_quote(); preg_match_all(); To many to list.
  12. Re: Installing V1   Use somethink like <?php //I only put <?php for the colors. $config = array('HostName' => 'localhost', 'UserName' => 'DATABASE USER', 'PassWord' => 'DATABASE PASSWORD', 'DataBase' => 'DATABASE NAME'); $c = mysql_connect($config['HostName'], $config['UserName'], $config['PassWord']) or die(mysql_error()); mysql_select_db($config['DataBase'], $c) or die(mysql_error()); Just edit the stuff where it says DATABASE USER, DATABASE PASS, DATABASE NAME. Should be done then.
  13. Re: Installing V1 Show the mysql.php file here. but of course without your user,pass,database.
  14. Re: Donators Gym $2   lol. Simpler is just. if(!$ir['donatordays']) { echo 'You are not a donator! [url="donator.php"]Click Here To Become One NOW![/url]'; $h->endpage(); exit; }   And why create a new Donator Gym, when you can just edit the normal gym.php you get with (mccodes) then basicly just if donator then blah else blah.
  15. Re: [MC-Codes][V2]Thugs (core system) Warning - while you were typing a new reply has been posted. You may wish to review your post. $action = ( isset($_GET['action']) && ctype_alpha($_GET['action']) ? htmlspecialchars(trim(strtolower($_GET['action']))) : FALSE);   You can tidy this code up with isset(); switch(); function(); int(); abs(); intval(); mysql_real_escape_string(); trim(); htmlspecialchars(); array(); in_array(); There's loads more you can use. You should make a function so you don't have to keep having to type mysql_real_escape_string(); and htmlspecialchars();   Example. function escape_data($data) { return mysql_real_escape_string(htmlspecialchars(trim($data))); } Then all you have to do is escape_data($_POST['username']); .. escape_data($ir['username']); .. escape_data($_POST['var']);
  16. Re: [MC-Codes][V2]Thugs (core system)   What is it with this Girl and Arrays shes Array mad. lol. No, its just simpler using array on some stuff.
  17. Re: [MC-Codes][V2]Thugs (core system) Ahh Yes Haunted Dawg Had it :) I forgot about that way :P
  18. Re: [uPDATE] V2 extract Users from Bots when adding to Battletent Why select everythink from the users table? function userbot_dropdown($connection,$ddname="userbot",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT `userid`, `username` FROM `users` WHERE `user_level` = 0 ORDER BY `username` ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } Plus you dont need all that code:).. $sql = $db->query("SELECT `userid`, `username` FROM `users` WHERE `user_level` = 0 ORDER BY `username` ASC") or die($db->error()); echo 'User: <select name="userbot">'; while($user = mysql_fetch_object($sql)) { echo '<option value="'. $user->userid .'">'. stripslashes($user->username) .'</option>'; } echo '</select>'; Less code the better :)
  19. Re: [MC-Codes][V2]Thugs (core system)   <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * ONLY EDIT THE FEILDS MARKED IN THE EDIT ZONE * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL */ //////////////////////////////////////////////// // EDIT THESE VALES FOR UR GAME // //////////////////////////////////////////////// //Hideout cost - This is the cost to buy a hideout $hideoutcost = 25000; // thug cost - This is the cost to hire a thug $thugcost = 10000; // Max Thugs - This is the max amount of thugs a user can have. $maxthugs = 15; if ($ir['donatordays']) { // Time till user can train a thug (donator) - set this to a nuber like 5 so the user can only train ONE thug every 5 mins $thugtraintime = 5; } else { // Time till user can train a thug (normal user) - set this to a nuber like 5 so the user can only train ONE thug every 5 mins $thugtraintime = 10; } ?>   You could of used a array(); $thug_config = array('hideoutcost' => 25000, 'thugcost' => 10000, 'maxthugs' => 15 'thugtraintime' = 5); Not to sure how to put if there donoator you get more what about IF() ?
  20. Re: Crystals V2 From what Haunted Dawg said you can just use the one below, same as his one but i just removed the (s) now it works fine. function buffer($content) { return preg_replace('~(crystal)~i','Tobacco', $content); } ob_start('buffer');   Add that in header right under the <?php
  21. Re: [V2] Mug feature with Stats!   Why did you take it out of the array there was no need for that at all.
  22. Re: [mccodes V2] Review staff.   Why is the code below that selecting from like 15+ tables there is no need select the stuff you need from a table. Eg. (`userid`, `username`). Also you have a error in the other file ;)
  23. Re: Crystals V2   Its quicker just simply returning it. function buffer($content) { return $content = preg_replace('~(crystals)~i','Tobacco', $content); }
  24. Re: cron_hour help   This line look's 10 times better below :) $db->query("UPDATE `gangs` SET `gangCHOURS` = (`gangCHOURS` - 1) WHERE ((`gangCHOURS` > 0) && (`gangCRIME` > 0))") or die($db->error());
  25. Re: [Mccodes V2] Shop Reduction Prices   if this is for itembuy.php it wont work because there is no sql to collect data from shops. Then make the SQL.
×
×
  • Create New...