Jump to content
MakeWebGames

CHAMAVELI

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Everything posted by CHAMAVELI

  1. Re: Need help; Mass file editing   Cause our most recent backup was not good enough. We had gone on a big script spree that week. Something could have exploited it Anyway fix my problem with Mass Text Editor 1.2. It's shareware, but does that job. Thanks anyway guys.
  2. Re: Need help; Mass file editing Ah thanks. Not using Dreamweaver, but I'll give it a try. If it doesn't want what I want to do I'll report back with my solution.   -CHAMAVELI
  3. Ok, site got semi-hacked and now EVERY PHP file has two lines of advertising code, which is all the same. I want to know if it's possible to mass edit all the files automatically by entering in there two lines and going through and either replacing them or removing them completely. Thanks in advanced, any help is much appreciated.
  4. Ok my friend was helping me with mutliple database connections and made me an error handler, but anyway I am now getting this error while logging in: Parse error: syntax error, unexpected T_GLOBAL, expecting T_FUNCTION in /home/gangland/public_html/functions/db.php on line 4 Here is the code for the db.php file. Please do not steal this file (it won't work without the other section anyway). <? //db.php class db { global $error; var $conn; if(!isset($error)) { require_once('functions/error.php'); $error = new error(); } function connect($dbhost= 'localhost',$dbuser = 'root',$dbpass = '',$dbname = ''){ $conn = @mysql_connect($dbhost,$dbuser,$dbpass); $dbselect = @mysql_select_db($dbname,$conn); if(!$conn) return $error->db(mysql_error(),true,true); else if(!$dbselect) return $error->db(mysql_error(),true,true); else $this->conn = $conn; } function query($sql = ''){ $result = @mysql_query($sql,$this->conn); if(!$result) return $error->db(mysql_error(),true); else return $result; } function freeresult($result = ''){ $clear = @mysql_free_result($result); if(!$clear) return $error->db(mysql_error(),false); } function close(){ mysql_close($this->conn); } } ?>
  5. Re: OC help, not working I have already tried the search and i'm not really good at it. Could someone post the link up?
  6. Re: [mccode v2]New Edit user It's still in the DB query, use this one: <?php include "sglobals.php"; //This contains user stuffs switch($_GET['action']) { case 'newuser': new_user_form(); break; case 'newusersub': new_user_submit(); break; case 'edituser': edit_user_begin(); break; case 'edituserform': edit_user_form(); break; case 'editusersub': edit_user_sub(); break; case 'invbeg': inv_user_begin(); break; case 'invuser': inv_user_view(); break; case 'deleinv': inv_delete(); break; case 'creditform': credit_user_form(); break; case 'creditsub': credit_user_submit(); break; case 'masscredit': mcredit_user_form(); break; case 'masscreditsub': mcredit_user_submit(); break; case 'reportsview': reports_view(); break; case 'repclear': report_clear(); break; case 'deluser': deluser(); break; case 'forcelogout': forcelogout(); break; default: print "Error: This script requires an action."; break; } function htmlspcl($in) { return str_replace("'", "'", htmlspecialchars($in)); } function new_user_form() { global $db,$ir, $c; if($ir['user_level'] != 2) { die("403"); } print "Adding a new user. <form action='staff_users.php?action=newusersub' method='post'> Username: <input type='text' name='username' /> Login Name: <input type='text' name='login_name' /> Email: <input type='text' name='email' /> Password: <input type='text' name='userpass' /> Type: <input type='radio' name='user_level' value='0' />NPC <input type='radio' name='user_level' value='1' checked='checked' />Regular Member Level: <input type='text' name='level' value='1' /> Money: <input type='text' name='money' value='100' /> Crystals: <input type='text' name='crystals' value='0' /> Donator Days: <input type='text' name='donatordays' value='0' /> Gender: <select name='gender' type='dropdown'><option>Male</option><option>Female</option></select> [b]Stats[/b] Strength: <input type='text' name='strength' value='10' /> Agility: <input type='text' name='agility' value='10' /> Guard: <input type='text' name='guard' value='10' /> Labour: <input type='text' name='labour' value='10' /> IQ: <input type='text' name='labour' value='10' /> <input type='submit' value='Create User' /></form>"; } function new_user_submit() { global $db,$ir,$c,$userid; if($ir['user_level'] != 2) { die("403"); } if(!isset($_POST['username']) || !isset($_POST['login_name']) || !isset($_POST['userpass'])) { print "You missed one or more of the required fields. Please go back and try again. [url='admin.php?action=newuser']> Back[/url]"; $h->endpage(); exit; } $level=abs((int) $_POST['level']); $money=abs((int) $_POST['money']); $crystals=abs((int) $_POST['crystals']); $donator=abs((int) $_POST['donatordays']); $ulevel=abs((int) $_POST['user_level']); $strength=abs((int) $_POST['strength']); $agility=abs((int) $_POST['agility']); $guard=abs((int) $_POST['guard']); $labour=abs((int) $_POST['labour']); $iq=abs((int) $_POST['iq']); $energy=10+$level*2; $brave=3+$level*2; $hp=50+$level*50; $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney) VALUES( '{$_POST['username']}', '{$_POST['login_name']}', md5('{$_POST['userpass']}'), $level, $money, $crystals, $donator, $ulevel, $energy, $energy, 100, 100, $brave, $brave, $hp, $hp, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1)"); $i=mysql_insert_id($c); $db->query("INSERT INTO userstats VALUES($i, $strength, $agility, $guard, $labour, $iq)"); print "User created!"; stafflog_add("Created user {$_POST['username']} [$i]"); } function edit_user_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } print "<h3>Editing User - Edit the users detais here.</h3> You can edit any aspect of this user. <form action='staff_users.php?action=edituserform' method='post'> User: ".user_dropdown($c,'user')." <input type='submit' value='Edit User' /></form> OR enter a user ID to edit: <form action='staff_users.php?action=edituserform' method='post'> User: <input type='text' name='user' value='0' /> <input type='submit' value='Edit User' /></form>"; } function edit_user_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403 access denied"); } $d=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us on u.userid=us.userid WHERE u.userid={$_POST['user']}"); $itemi=$db->fetch_row($d); $itemi['hospreason']=htmlspcl($itemi['hospreason']); $itemi['jail_reason']=htmlspcl($itemi['jail_reason']); print "<h3>Editing User </h3> <form action='staff_users.php?action=editusersub' method='post'> <input type='hidden' name='userid' value='{$_POST['user']}' /> <table border=2> <th>User finance</th> <th>User's name + stats</th> <th>Banned?</th> <th>User genral</th> <tr> <td> Money: \$<input type='text' name='money' value='{$itemi['money']}' /> Bank: \$<input type='text' name='bankmoney' value='{$itemi['bankmoney']}' /> Cyber Bank: \$<input type='text' name='cybermoney' value='{$itemi['cybermoney']}' /> Crystals: <input type='text' name='crystals' value='{$itemi['crystals']}' /> Posts: <input type='text' name='posts' value='{$itemi['posts']}' /> User voted?: <input type='text' name='voted' value='{$itemi['voted']}' /> House: ".house2_dropdown($c, "maxwill", $itemi['maxwill'])." </td> <td> Username: <input type='text' name='username' value='{$itemi['username']}' /> Login Name: <input type='text' name='login_name' value='{$itemi['login_name']}' /> Strength: <input type='text' name='strength' value='{$itemi['strength']}' /> Agility: <input type='text' name='agility' value='{$itemi['agility']}' /> Guard: <input type='text' name='guard' value='{$itemi['guard']}' /> Labour: <input type='text' name='labour' value='{$itemi['labour']}' /> IQ: <input type='text' name='IQ' value='{$itemi['IQ']}' /> </td> <td> Email: <input type='text' name='email' value='{$itemi['email']}' /> Duties: <input type='text' name='duties' value='{$itemi['duties']}' /> Staff Notes: <input type='text' name='staffnotes' value='{$itemi['staffnotes']}' /> Mail Ban: <input type='text' name='mailban' value='{$itemi['mailban']}' /> Mail Ban Reason: <input type='text' name='mb_reason' value='{$itemi['mb_reason']}' /> Forum Ban: <input type='text' name='forumban' value='{$itemi['forumban']}' /> Forum Ban Reason: <input type='text' name='fb_reason' value='{$itemi['fb_reason']}' /> </td> <td> daysold: <input type='text' name='daysold' value='{$itemi['daysold']}' /> Donator Days: <input type='text' name='donatordays' value='{$itemi['donatordays']}' /> Level: <input type='text' name='level' value='{$itemi['level']}' /> Hospital time: <input type='text' name='hospital' value='{$itemi['hospital']}' /> Hospital reason: <input type='text' name='hospreason' value='{$itemi['hospreason']}' /> Jail time: <input type='text' name='jail' value='{$itemi['jail']}' /> Jail reason: <input type='text' name='jail_reason' value='{$itemi['jail_reason']}' /> </tr> </td> </table> <input type='submit' value='Edit User' /></form>"; } function edit_user_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } $go=0; if(!isset($_POST['level'])) { $go=1; } if(!isset($_POST['email'])) { $go=1; } if(!isset($_POST['money'])) { $go=1; } if(!isset($_POST['posts'])) { $go=1; } if(!isset($_POST['voted'])) { $go=1; } if(!isset($_POST['daysold'])) { $go=1; } if(!isset($_POST['bankmoney'])) { $go=1; } if(!isset($_POST['crystals'])) { $go=1; } if(!isset($_POST['strength'])) { $go=1; } if(!isset($_POST['agility'])) { $go=1; } if(!isset($_POST['guard'])) { $go=1; } if(!isset($_POST['labour'])) { $go=1; } if(!isset($_POST['IQ'])) { $go=1; } if(!isset($_POST['username'])) { $go=1; } if(!isset($_POST['login_name'])) { $go=1; } if($go) { print "You did not fully fill out the form."; $_POST['user']=$_POST['userid']; edit_user_form(); } else { $_POST['level']=(int) $_POST['level']; $_POST['strength']=abs((int) $_POST['strength']); $_POST['agility']=abs((int) $_POST['agility']); $_POST['guard']=abs((int) $_POST['guard']); $_POST['labour']=abs((int) $_POST['labour']); $_POST['IQ']=abs((int) $_POST['IQ']); $_POST['money']=(int) $_POST['money']; $_POST['voted']=(int) $_POST['voted']; $_POST['donatordays']=(int) $_POST['donatordays']; $_POST['daysold']=(int) $_POST['daysold']; $_POST['posts']=(int) $_POST['posts']; $_POST['bankmoney']=(int) $_POST['bankmoney']; $_POST['cybermoney']=(int) $_POST['cybermoney']; $_POST['crystals']=(int) $_POST['crystals']; $_POST['mailban']=(int) $_POST['mailban']; $_POST['forumban']=(int) $_POST['forumban']; $maxwill=abs((int) $_POST['maxwill']); //check for username usage $u=$db->query("SELECT * FROM users WHERE username='{$_POST['username']}' and userid != {$_POST['userid']}"); if($db->num_rows($u) != 0) { print "That username is in use, choose another."; print " [url='admin.php?action=edituser']> Back[/url]"; $h->endpage(); exit; } $oq=$db->query("SELECT * FROM users WHERE userid={$_POST['userid']}"); $rm=$db->fetch_row($oq); $will=($rm['will'] > $maxwill) ? $maxwill: $rm['will']; $energy=10+$_POST['level']*2; $nerve=3+$_POST['level']*2; $hp=50+$_POST['level']*50; $db->query("UPDATE users SET username='{$_POST['username']}', daysold={$_POST['daysold']}, donatordays={$_POST['donatordays']}, email='{$_POST['email']}', level={$_POST['level']}, money={$_POST['money']}, crystals={$_POST['crystals']}, energy=$energy, brave=$nerve, maxbrave=$nerve, maxenergy=$energy, hp=$hp, maxhp=$hp, hospital={$_POST['hospital']}, jail={$_POST['jail']}, duties='{$_POST['duties']}', staffnotes='{$_POST['staffnotes']}', mailban={$_POST['mailban']}, mb_reason='{$_POST['mb_reason']}', forumban={$_POST['forumban']}, fb_reason='{$_POST['fb_reason']}', hospreason='{$_POST['hospreason']}', jail_reason='{$_POST['jail_reason']}', login_name='{$_POST['login_name']}', will=$will, maxwill=$maxwill WHERE userid={$_POST['userid']}"); $db->query("UPDATE userstats SET strength={$_POST['strength']}, agility={$_POST['agility']}, guard={$_POST['guard']}, labour={$_POST['labour']}, IQ={$_POST['IQ']} WHERE userid={$_POST['userid']}"); stafflog_add("Edited user {$_POST['username']} [{$_POST['userid']}]"); print "User edited."; } } function deluser() { global $ir,$c,$h,$userid,$db; if($ir['user_level'] != 2) { die("403"); } $undeletable = array('1','2'); // add more IDs here, such as NPCs switch ($_GET['step']) { default: echo "<h3>Deleteing User</h3> Here you can delete a user. <form action='staff_users.php?action=deluser&step=2' method='post'> User: ".user_dropdown($c,'user')." <input type='submit' value='Delete User' /></form> OR enter a user ID to Delete: <form action='staff_users.php?action=deluser&step=2' method='post'> User: <input type='text' name='user' value='0' /> <input type='submit' value='Delete User' /></form>"; break; case 2: $target = $_POST['user']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) { die('You cannot delete this person.'); } $d=$db->query("SELECT username FROM users WHERE userid='$target'"); $itemi=$db->fetch_row($d); print "<h3>Confirm</h3> Delete user ".$itemi["username"]."? <form action='staff_users.php?action=deluser&step=3' method='post'> <input type='hidden' name='userid' value='$target' /> <input type='submit' name='yesorno' value='Yes' /> <input type='submit' name='yesorno' value='No' onclick=\"window.location='staff_users.php?action=deluser';\" /></form>"; break; case 3: $target = $_POST['userid']; if (!is_numeric($target)) exit; if (in_array($target,$undeletable)) { die('You cannot delete this person.'); } if($_POST['yesorno']=='No') { die("User not deleted. [url='staff_users.php?action=deluser']>Back to main Delete Users page.[/url]"); } if ($_POST['yesorno'] != ("No" || "Yes")) die('Eh'); $d=$db->query("SELECT username FROM users WHERE userid='$target'"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM users WHERE userid='$target'"); $db->query("DELETE FROM userstats WHERE userid='$target'"); $db->query("DELETE FROM inventory WHERE inv_userid='$target'"); $db->query("DELETE FROM fedjail WHERE fed_userid='$target'"); echo "User {$itemi['username']} Deleted. [url='staff_users.php?action=deluser']>Back to main Delete Users page.[/url]"; stafflog_add("Deleted User {$itemi['username']} [{$_POST['userid']}]"); break; } } function inv_user_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } print "<h3>Viewing User Inventory</h3> You may browse this user's inventory. <form action='staff_users.php?action=invuser' method='post'> User: ".user_dropdown($c,'user')." <input type='submit' value='View Inventory' /></form>"; } function inv_user_view() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $d=$db->query("SELECT username FROM users WHERE userid='{$_POST['user']}'"); $un=$db->fetch_single($d); $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$_POST['user']}"); if ($db->num_rows($inv) == 0) { print "[b]This person has no items![/b]"; } else { print "[b]Their items are listed below.[/b] <table width=100%><tr style='background-color:gray;'><th>Item</th><th>Sell Value</th><th>Total Sell Value</th><th>Links</th></tr>"; while($i=$db->fetch_row($inv)) { print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print "</td><td>[[url='staff_users.php?action=deleinv&ID={$i[']Delete[/url]]"; print "</td></tr>"; } print "</table>"; } stafflog_add("Viewed user {$un} [{$_POST['user']}] inventory"); } function inv_delete() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $db->query("DELETE FROM inventory WHERE inv_id={$_GET['ID']}"); print "Item deleted from inventory."; stafflog_add("Deleted inventory ID {$_GET['ID']}"); } function credit_user_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } print "<h3>Crediting User</h3> You can give a user money/crystals. <form action='staff_users.php?action=creditsub' method='post'> User: ".user_dropdown($c,'user')." Money: <input type='text' name='money' /> Crystals: <input type='text' name='crystals' /> <input type='submit' value='Credit User' /></form>"; } function credit_user_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_POST['money'] = (int) $_POST['money']; $_POST['crystals'] = (int) $_POST['crystals']; $db->query("UPDATE users u SET money=money+{$_POST['money']}, crystals=crystals+{$_POST['crystals']} WHERE u.userid={$_POST['user']}"); print "User credited."; $d=$db->query("SELECT username FROM users WHERE userid='{$_POST['user']}'"); $un=$db->fetch_single($d); stafflog_add("Credited $un [{$_POST['user']}] \${$_POST['money']} and/or {$_POST['crystals']} crystals."); } function mcredit_user_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Mass Payment</h3> You can give all users money/crystals. <form action='staff_users.php?action=masscreditsub' method='post'> Money: <input type='text' name='money' /> Crystals: <input type='text' name='crystals' /> <input type='submit' value='Credit User' /></form>"; } function mcredit_user_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $_POST['money'] = (int) $_POST['money']; $_POST['crystals'] = (int) $_POST['crystals']; $db->query("UPDATE users u SET money=money+{$_POST['money']}, crystals=crystals+{$_POST['crystals']}"); print "All Users credited. Click [url='staff.php?action=announce']here to add an announcement[/url] or [url='staff_special.php?action=massmailer']here to send a mass mail[/url] explaining why."; stafflog_add("Credited all users \${$_POST['money']} and/or {$_POST['crystals']} crystals."); } function reports_view() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } print "<h3>Player Reports</h3> <table width=80%><tr style='background:gray'><th>Reporter</th> <th>Offender</th> <th>What they did</th> <th> </th> </tr>"; $q=$db->query("SELECT pr.*,u1.username as reporter, u2.username as offender FROM preports pr LEFT JOIN users u1 ON u1.userid=pr.prREPORTER LEFT JOIN users u2 ON u2.userid=pr.prREPORTED ORDER BY pr.prID DESC"); while($r=$db->fetch_row($q)) { print "\n<tr> <td>[url='viewuser.php?u={$r[']{$r['reporter']}[/url] [{$r['prREPORTER']}]</td> <td>[url='viewuser.php?u={$r[']{$r['offender']}[/url] [{$r['prREPORTED']}]</td> <td>{$r['prTEXT']}</td> <td>[url='staff_users.php?action=repclear&ID={$r[']Clear[/url]</td> </tr>"; } print "</table>"; } function forcelogout() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $_POST['userid'] = abs((int) $_POST['userid']); if($_POST['userid']) { $db->query("UPDATE users SET force_logout=1 WHERE userid={$_POST['userid']}"); print "User ID {$_POST['userid']} successfully forced to logout."; stafflog_add("Forced User ID {$_POST['userid']} to logout"); } else { print "<h3>Force User Logout</h3><hr /> The user will be automatically logged out next time he/she makes a hit to the site.<form action='staff_users.php?action=forcelogout' method='post'> User: ".user_dropdown($c, 'userid')." <input type='submit' value='Force User to Logout' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?>
  7. Ok I just tested the OCs on my V2 game again and there not working. I can create, edit and delete them and make it that the gang starts the OC, but after the certain amount of time the OC needs for preperation it just goes into -number of hours left. I havn't touched the OCs and they were working a while ago. I'm thinking it's something in the day cron not doing the OC so i have posted that up aswell. <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) WHERE bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) WHERE cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;"); $db->query("UPDATE rentals set reDAYS=reDAYS-1"); $io=$db->query("SELECT * FROM users where rent>0"); $hu=$db->fetch_row($io); $gd=$db->query("SELECT * FROM rentals WHERE reRENTER={$hu['userid']}"); $hd=$db->fetch_row($gd); $db->query("UPDATE users set money=money-{$hd['reCOST']} WHERE userid={$hd['reRENTER']}"); $q=$db->query("SELECT * FROM rentals WHERE reDAYS=0"); $ids=array(); while($r=$db->fetch_row($q)) { if (!$r['reDAYS']) { $rf=$db->query("SELECT * FROM properties WHERE prID={$r['rePID']}"); $gf=$db->fetch_row($rf); $db->query("DELETE FROM properties WHERE prID={$r['rePID']}"); $db->query("UPDATE users SET rent=0 WHERE userid={$r['reRENTER']}"); $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('{$r['rePID']}', '{$r['reOWNER']}', '{$gf['prHOUSE']}');",$c); $db->query("DELETE FROM rentals WHERE reDAYS=0"); } } ?>
  8. Re: Very confused need help! Ok the problem is that they are already defined. If someone would mind looking at my code to check the error it would be great. I have to upload it as it exceeds the character limit.
  9. Ok i'm making a delete gang mod and I added the cases in the staff section now I get theses errors when I visit the pages on the two that I added Fatal error: Call to undefined function gang_staff_del() in /home/gangland/public_html/yourgang.php on line 459 Fatal error: Call to undefined function gang_staff_del1() in /home/gangland/public_html/yourgang.php on line 463 Now these are lines 458-464 case "del": gang_staff_del(); break; case "del1": gang_staff_del1(); break;
  10. Re: [mccode v2] PJIRC Chat Mod It's most likely all of you don't have Java installed. Try updating your Java and see if it works. I'm trying it now so I'll let you know how it goes. EDIT: Nope sorry guys, I get the same problem. Maybe it doesn't work on all OS's, could be a Windows only program since most servers are using Linux. But I don't know.
  11. Hey guys im very new to PHP and I wanted to know how to add an action like file.php?action=howtodothis Please don't bag me out and if anyone could give me a website that has all these basic things could you please point me there. Thanks, CHAMAVELI.
  12. Re: Modification Help OK that seems like a better idea. Could someone maybe give me some example code?
  13. Re: [v1][FREE] DONATION PACKS TO ITEMS   Post it help us other guys out.
  14. Re: [v1][FREE] DONATION PACKS TO ITEMS Ok i've got the DP items working now but how do I make it credit the user with the DP item when they donate? Thats the only problem I have, If someone could please help me it would be great.
  15. Re: Modification Help Well I want to try do it myself with help, because If I keep getting people to do it for me I won't learn.
  16. Hey guys im making my own mod (not from scratch) by modifying the Mccodes V2 attack system and make it available in jail. I needed help with two things, the user will have to have a certain item to attack in jail, and I need to know the code to check if the user has the item. The second thing I need help with is that the user will need to make this item in jail, it takes 100 energy and will take 10 minutes. Should I make this file to make the item set something in the database to 10 and every minute the cron will remove one? If it works like this how would i make the cron credit the user with the item after the 10 minutes is over, something like if the make-item-time coloumn = 1 then it would set 1 to 0 and credit the user with the item? I'm not sure if it makes sence but I need someone to help me because im new to PHP but this sounds like an easy mod. Thanks.
  17. Re: Secure all pages using globals or header   Is your engine going to be free or will it cost?
  18. Re: Big gang problem, Cannot create Thanks for that guys. Im so stupid that I didn't try this before. Thanks again.
  19. Re: Secure all pages using globals or header Ok thanks for the replies. Would you guys by any change know the in-secure files in Mccodes V2?
  20. Re: Secure all pages using globals or header What it was saying is that the Mccodes game is un secure so we have to secure it from hackers so they cant abuse the crystal market or what ever. I was asking if there is a code that I can insert into the header that will secure all the pages instead of me modifying every page that needs to be secure.
  21. Re: Big gang problem, Cannot create The only mod I added was my own gang image mod, but I don't think that has anything to do with creating a gang.
  22. Is it possible to secure all pages by inserting the codes into globals.php or header.php. If it is could someone please give me the codes to secure the Mccodes V2 game. Im new to PHP and this is a project to help me learn so I need you to explain it as though I was an idiot. Thanks.
  23. Hey guys I've just been fiddeling around with a mod for my gangs, but I cannot create a gang for some reason now. i havnt changed anything in the DB or the creategang.php file and I don't know what the problem is. I could make gangs before but now it just won't work. I get this error: QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO gangs VALUES('','test','test','','',0,0,100,3,3,5,0,0,'')
  24. Hey guys I finally ran into the problem of the item merging in Mccodes V2 and found this mod: http://criminalexistence.com/ceforums/i ... ic=20546.0 Is it possible to add this into the global_func.php file so that it will automatacally merge the items, but I don't want it to display anything. Thanks.
  25. Hey guys, my host doesn't allow 1 min crons so I have changed it to 5 mins, but now if something is under 5 minutes in jail or hospital it will go to -X minutes and then if they get put into jail X will come off how much time their in jail or hospital for. I wanted to know if its possible to make it, if the time is under 5 minutes to remove the number without going into minus. Thanks.
×
×
  • Create New...