
jds137
Members-
Posts
402 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by jds137
-
Re: [mccode v2] Scare People Hospital works now, I made it random time. Also there is an event now. As far as the other errors go, Ill let some one else fix it. :P <?php include "globals.php"; print "<h2>Scare</h2>"; if ($ir['hospital']) { print "You cannot scare people while in hospital"; $h->endpage(); exit; } if ($ir['prison']) { print "You cannot scare people while in prison"; $h->endpage(); exit; } if ($ir['scare']) { print "You cannot scare people while you are scared"; $h->endpage(); exit; } if ($ir['energy'] < 10) { print "You cannot scare people until you have 10 energy."; $h->endpage(); exit; } if ($_GET['scare'] == yes) { $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); $r=$db->fetch_row($q); if ($ir['userid'] == $r['userid']) { print "You cannot scare yourself"; $h->endpage(); exit; } $db->query("UPDATE users SET energy=energy-10 where userid=$userid",$c); $chance = rand(1,4); if ($chance == 1) { $hosp = rand(15,25); mysql_query("update users set hospital=$hosp where userid='" . mysql_real_escape_string($userid) . "'", $c); mysql_query("update users set hospreason='Was Punched in the nose trying scare {$r['username']}' where userid='" . mysql_real_escape_string($userid) . "'", $c); print "You go up to {$r['username']} to scare the living daylights out of them exept they turn around, then punch you in the nose, you get up and run to hospital."; } else if ($chance == 2) { print " You go to scare {$r['username']} but turn around before you have the chance, you walk away briskly. <hr width=\"85%\" /> <a href=\"index.php\">[b]Back[/b]</a>"; } else { $scare = rand(5,20); $db->query("UPDATE users SET scare=scare=$scare where userid={$_GET['ID']}",$c); print " You have successfully scared {$r['username']} for $scare minutes."; event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] Scarred the crap out of you", $c); print " <hr width=\"85%\" /> <a href=\"index.php\">[b]Back[/b]</a>"; } } else { $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); $r=$db->fetch_row($q); if ($ir['userid'] == $r['userid']) { print "You cannot scare yourself"; $h->endpage(); exit; } print " Are you sure you wish to scare <a href=\"viewuser.php?u={$r['userid']}\">{$r['username']}</a>? <table> <td> <a href=\"scare.php?scare=yes&ID={$_GET['ID']}\">[b]Yes[/b]</a> </td> <td>||</td> <td> <a href=\"index.php\">[b]No[/b]</a> </td>"; } $h->endpage(); ?>
-
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
jds137 replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] Leave em alone. I remember when Illusions first came here, alot of you picked on his work. And he used to want to say fuck it, CE doesn't care. Now you know he is a good coder, and you cry when he doesn't finish something. Its a freaking sire, where we are supposed to help each other out. Now you think you are coders, then why has no body bedsides Zero helped Illusions out. If you were to get your head out your ass, it may of been done by now. And thats for others here too. -
[mccode v2] Pass Parcel or Secret Santa [Working Copy]
jds137 replied to Uridium's topic in Free Modifications
Re: [Mccodes v2] Pass Parcel or Secret Santa [Working Copy] I admit it, I beat illusions with a club, and hid em in zeros basement. So I guess no more xmas codes from him. -
Re: [mccode V2] Rate User['s] In the mod, the count never goes up on a profile
-
Re: [MCcode V2] Item Market Revamped I received this error: QUERY ERROR: Unknown column 'im.imITEM' in 'on clause' Query was SELECT im.`imID`,`imITEM`,`imADDER`,`imPRICE`,`imCURRENCY`, i.`itmid`,`itmtype` FROM `itemmarket` im LEFT JOIN `items` i ON `im.imITEM` = 0 WHERE `imID` = 2 AND `imADDER` = 2
-
Re: [mccode V2] City Pic xD I would also like to thank Illusions, as he was talking to me, and I commented about the first post. Then he coded it the right way. And I know Illusions mods work. As alot of my are the ones he posted here. +100
-
Re: [MCcode V2] Item Market Revamped I think its a great job. I had just removed my market, due to it being a piece of cr@p. Now I can readd it with this one. t/y
-
Re: [mccode V2] City Pic xD Ill take the above back. What you added to the CE forums was absolute gibberish. It needs to have more to it, and you should be kicked for not sharing. Its things like this that clog up the forums. Crap things that dont work...
-
Re: [mccode V2] City Pic xD I really am curious how this works. I tried it, and did not get any wheres.
-
Re: [mccode v1] Carnival Does anyone have one that works. lol
-
Re: [mccode v2] Nynas Gym Question I wish I could remember what file mod it.
-
Re: [mccode v2] Nynas Gym Question I already did all that. I also tried a few other versions of it. What else could cause the will drop?
-
I installed the gym Nyna made a while back, and had a question about it. In my site, when users train in the gym, it takes all their will. But in other games, it does not take all their will. What would cause this? And how do I fix it? <?php $macropage = "gym2.php"; include "globals.php"; if($ir['alcohol'] > 4) { die("You're too drunk to train at the gym. Go to <a href = 'clubrecover.php' />the Recovery Center</a> to sober up."); } if($ir['hrepair'] > 0) { die("You need to repair your house first before you can access this page. Go <a href = 'burnhouse.php?action=repair' />HERE</a> to repair your house."); } if($ir['gympass']== 0) { die("You do not have a gym pass, >[url='passesshop.php']Buy a gym pass[/url]"); } if($ir['pagetutorials'] == ON) { print " <table width=75% border=3 bordercolor=#BDBDBD cellspacing=0 bgcolor=white frame=border rules=none> <tr><td width=75><img src=images/flashing_amykhar.gif> <font color=blue>[i][[url="preferences.php><font"][i]Turn Off[/i]</font>[/url]][/i]</font></center></td><td>[b]Gym:[/b]<font color=#000000 size=2>Inside the Gym you can train you stats, these include: Strength, Agility, Guard, and Labour. You can also choose how much energy to use per each visit to the gym. </font></td></tr></table> "; } global $db, $h, $ir, $userid; if ($ir['hospital']) { echo " You cannot access the gym while in the hospital</p>"; $h->endpage(); exit; } $prefs = isset($_SESSION['gymprefs']) ? $_SESSION['gymprefs'] : array('what' => "all", 'expend' => "100%"); $what = $prefs['what']; $expend = $prefs['expend']; $message = false; $sql = sprintf("SELECT us.strength, us.agility, us.guard, us.labour, u.energy, u.will, u.prison FROM users u LEFT JOIN userstats us ON (u.userid = us.userid) WHERE (u.userid = %u)", $userid); $row = $db->fetch_row($db->query($sql)); $formID = preg_replace("`^([0-9A-F]{8})([0-9A-F]{4})([0-9A-F]{4})([0-9A-F]{4})([0-9A-F]{12})$`ms", "{\\1-\\2-\\3-\\4-\\5}", strtoupper(md5(serialize(array(session_id(), "Gym", null))))); if (isset($_POST['formID']) && is_string($_POST['formID']) && ($_POST['formID'] === $formID)) { $what = isset($_POST['what']) && is_string($_POST['what']) && preg_match("`^((all)|(strength)|(agility)|(guard)|(labour))$`ims", $_POST['what']) ? strtolower($_POST['what']) : $what; $expend = isset($_POST['expend']) && is_string($_POST['expend']) && preg_match("`^((100%)|(75%)|(50%)|(25%)|(value))$`ims", $_POST['expend']) ? strtolower($_POST['expend']) : $expend; $value = isset($_POST['value']) && is_string($_POST['value']) && preg_match("`^\d+$`ims", $_POST['value']) ? @intval($_POST['value']) : 0; $sql = sprintf("SELECT energy, will FROM users WHERE (userid = %u)", $userid); $rs = $db->query($sql); $info = $db->fetch_row($rs); $energy = $row['energy']; $will = $row['will']; switch ($expend) { case "100%": $value = $row['energy']; break; case "75%": $value = $row['energy'] * 0.75; break; case "50%": $value = $row['energy'] * 0.50; break; case "25%": $value = $row['energy'] * 0.25; break; default: break; } $value = floor($value); if ($value > $row['energy']) $message = "<span style='color:blue;'>You don't have enough energy</span>"; else { $prefs = array('what' => $what, 'expend' => $expend); $gain = 0; $will = $row['will']; for ($i = 0; $i < $value; $i++) { $gain += mt_rand(1, 3) / mt_rand(500, 900) * mt_rand(500, 900) * (($will + 10) / 150); $will = max(0, $will - mt_rand(1, 3)); } if ($row['prison']) $gain *= 0.5; $row['will'] = floor($will); $row['energy'] -= $value; switch ($what) { case "all": $message = sprintf("<span style='color:blue;'>You gain %s in each stat</span>", number_format($gain * 0.25, 2)); $row['strength'] += $gain * 0.25; $row['agility'] += $gain * 0.25; $row['guard'] += $gain * 0.25; $row['labour'] += $gain * 0.25; break; case "strength": $message = sprintf("<span style='color:blue;'>You gain %s in strength</span>", number_format($gain, 2)); $row['strength'] += $gain; break; case "agility": $message = sprintf("<span style='color:blue;'>You gain %s in agility</span>", number_format($gain, 2)); $row['agility'] += $gain; break; case "guard": $message = sprintf("<span style='color:blue;'>You gain %s in guard</span>", number_format($gain, 2)); $row['guard'] += $gain; break; case "labour": $message = sprintf("<span style='color:blue;'>You gain %s in labour</span>", number_format($gain, 2)); $row['labour'] += $gain; break; } $sql1 = sprintf("UPDATE userstats SET strength = %.6f, agility = %.6f, guard = %.6f, labour = %.6f WHERE (userid = %u)", $row['strength'], $row['agility'], $row['guard'], $row['labour'], $userid); $sql2 = sprintf("UPDATE users SET will = %u, energy = %d WHERE (userid = %u)", $row['will'], $row['energy'], $userid); $db->query($sql1); $db->query($sql2); } $_SESSION['gymprefs'] = $prefs; } $row['ranks'] = array ( 'strength' => $db->fetch_single($db->query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (strength > %.6f)", $row['strength']))) + 1, 'agility' => $db->fetch_single($db->query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (agility > %.6f)", $row['agility']))) + 1, 'guard' => $db->fetch_single($db->query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (guard > %.6f)", $row['guard']))) + 1, 'labour' => $db->fetch_single($db->query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (labour > %.6f)", $row['labour']))) + 1, 'total' => $db->fetch_single($db->query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (strength + agility + guard + labour > %.6f)", $row['strength'] + $row['agility'] + $row['guard'] + $row['labour']))) + 1, ); echo "<style type='text/css'>"; echo "#gym { }"; echo "#gym h3, #gym p { }"; echo "#gym table { width:90%;border-collapse:collapse; }"; echo "#gym th { border:solid 1px #333;background:#ddedde url(titlebg.gif);padding:3px;color:blue; }"; echo "#gym td { border:solid 1px #333;padding:3px;color:blue; }"; echo "#gym { }"; echo "</style>"; echo "<div id='gym'>"; echo sprintf("<h3>%sGym</h3>", $ir['prison'] ? "Prison " : ""); if ($message) echo sprintf(" %s</p>", $message); echo "<form name='train' id='train' action='gym2.php' method='post' style='padding:0;margin:0;'>"; echo sprintf("<input type='hidden' name='formID' value='%s' />", $formID); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr>"; echo "<th class='sub' style='width:50%;'>Train</th>"; echo "<th class='sub' style='width:50%;'>Expend</th>"; echo "</tr>"; echo "<tr>"; echo "<td style='line-height:200%;'>"; echo sprintf("<input type='radio' name='what' id='what0' value='all' %sstyle='vertical-align:middle;' /><label for='what0' style='cursor:pointer;'>All (25%% energy in each) [Rank #%s]</label> ", $what === "all" ? "checked='checked' " : "", number_format($row['ranks']['total'])); echo sprintf("<input type='radio' name='what' id='what1' value='strength' %sstyle='vertical-align:middle;' /><label for='what1' style='cursor:pointer;'>Strength (%s) [Rank #%s]</label> ", $what === "strength" ? "checked='checked' " : "", number_format($row['strength']), number_format($row['ranks']['strength'])); echo sprintf("<input type='radio' name='what' id='what2' value='agility' %sstyle='vertical-align:middle;' /><label for='what2' style='cursor:pointer;'>Agility (%s) [Rank #%s]</label> ", $what === "agility" ? "checked='checked' " : "", number_format($row['agility']), number_format($row['ranks']['agility'])); echo sprintf("<input type='radio' name='what' id='what3' value='guard' %sstyle='vertical-align:middle;' /><label for='what3' style='cursor:pointer;'>Guard (%s) [Rank #%s]</label> ", $what === "guard" ? "checked='checked' " : "", number_format($row['guard']), number_format($row['ranks']['guard'])); echo sprintf("<input type='radio' name='what' id='what4' value='labour' %sstyle='vertical-align:middle;' /><label for='what4' style='cursor:pointer;'>Labour (%s) [Rank #%s]</label> ", $what === "labour" ? "checked='checked' " : "", number_format($row['labour']), number_format($row['ranks']['labour'])); echo "</td>"; echo "<td style='line-height:200%;'>"; echo sprintf("<input type='radio' name='expend' id='expend0' value='100%%' %sstyle='vertical-align:middle;' /><label for='expend0' style='cursor:pointer;'>100%% Energy</label> ", $expend === "100%" ? "checked='checked' " : ""); echo sprintf("<input type='radio' name='expend' id='expend1' value='75%%' %sstyle='vertical-align:middle;' /><label for='expend1' style='cursor:pointer;'>75%% Energy</label> ", $expend === "75%" ? "checked='checked' " : ""); echo sprintf("<input type='radio' name='expend' id='expend2' value='50%%' %sstyle='vertical-align:middle;' /><label for='expend2' style='cursor:pointer;'>50%% Energy</label> ", $expend === "50%" ? "checked='checked' " : ""); echo sprintf("<input type='radio' name='expend' id='expend3' value='25%%' %sstyle='vertical-align:middle;' /><label for='expend3' style='cursor:pointer;'>25%% Energy</label> ", $expend === "25%" ? "checked='checked' " : ""); echo sprintf("<input type='radio' name='expend' id='expend4' value='value' %sstyle='vertical-align:middle;' onclick='document.train.value.focus();' /><label for='expend4' style='cursor:pointer;'><input type='text' id='value' name='value' value='{$row['energy']}' size='8' onfocus='this.select();' /> Energy</label> ", $expend === "value" ? "checked='checked' " : "");//(C)2008,Nyna echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='text-align:center;padding:6px;'>"; echo "<input type='submit' name='submit' value='Train' />"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</form>"; echo "</div>"; echo "<p style='color:brown;'>An open-source extension from <a href='http://nyna.co.uk/' style='color:brown;font-variant:small-caps;'>Nyna Many thanks to Nyna for this mod </a></p>"; $h->endpage(); ?>
-
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
jds137 replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals All I basically have done, is split schooling into separate areas. courses, and course By renaming the scripts, I have enabled another education system to be added. I like having a donator, and non donator school system. Hopefully my game feels the same. -
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
jds137 replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals Next step add: staff_clicks.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains course stuffs switch($_GET['action']) { case "addcourse": addcourse(); break; case "editcourse": editcourse(); break; case "delcourse": delcourse(); break; default: print "Error: This script requires an action."; break; } function addcourse() { global $db, $ir, $c, $h, $userid; $cost=abs((int) $_POST['cost']); $tokens=abs((int) $_POST['tokens']); $energy=abs((int) $_POST['energy']); $days=abs((int) $_POST['days']); $clicks=abs((int) $_POST['clicks']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); if($_POST['name'] && $_POST['desc'] ) { $db->query("INSERT INTO course VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '$cost', '$tokens', '$energy', '$days', '$clicks', '$str', '$gua', '$lab', '$agil', '$iq')"); print "Course {$_POST['name']} added."; stafflog_add("Added course {$_POST['name']}"); } else { print "<h3>Add Course</h3><hr /> <form action='staff_clicks.php?action=addcourse' method='post'> Name : <input type='text' name='name' value=''/> Description : <input type='text' name='desc' value=''/> Cost (Money) : <input type='text' name='cost' value='0'/> Cost (Energy) : <input type='text' name='energy' value='0'/> Length (Days) : <input type='text' name='days' value='0'/> Cost (Tokens) : <input type='text' name='tokens' value='0'/> Length (Clicks) : <input type='text' name='clicks' value='0'/> Strength Gain : <input type='text' name='str' value='0'/> Agility Gain : <input type='text' name='agil' value='0'/> Guard Gain : <input type='text' name='gua' value='0'/> Labour Gain : <input type='text' name='lab' value='0'/> IQ Gain : <input type='text' name='iq' value='0'/> <input type='submit' value='Add Course' style='border:1px solid #3366CC; font-family:Arial; font-size:14pt; letter-spacing:1; color:#3366CC; background-color:#FFFFFF' style='font-family: Arial; font-size: 10pt; letter-spacing: 1; color: #3366CC; border: 3px solid #dedede; background-color: #FFFFFF'/></form>"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $days=abs((int) $_POST['days']); $clicks=abs((int) $_POST['clicks']); $tokens=abs((int) $_POST['tokens']); $str=abs((int) $_POST['str']); $agil=abs((int) $_POST['agil']); $gua=abs((int) $_POST['gua']); $lab=abs((int) $_POST['lab']); $iq=abs((int) $_POST['iq']); $name=$_POST['name']; $db->query("UPDATE course SET crNAME='$name', crDESC='{$_POST['desc']}', crCOST=$cost, crENERGY=$energy, crCRYSTALS=$tokens, crDAYS=$days, crCLICKS=$clicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "Course $name was edited successfully. [url='staff_clicks.php']<h2>Return to Courses page</h2>[/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM course WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_clicks.php?action=editcourse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> Name: <input type='text' name='name' value='{$old['crNAME']}' /> Description: <input type='text' name='desc' value='{$old['crDESC']}' /> Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> Cost (Tokens): <input type='text' name='tokens' value='{$old['crCRYSTALS']}' /> Length (Days): <input type='text' name='days' value='{$old['crDAYS']}' /> Length (Clicks): <input type='text' name='clicks' value='{$old['crCLICKS']}' /> Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> <input type='submit' value='Edit Course' /></form>"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_clicks.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form> [url='staff_clicks.php']<h2>Return to Courses page</h2>[/url]"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM course WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cclicks=0, cdays=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM course WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted."; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> <form action='staff_clicks.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_clicks.php']<h2>Return to Courses page</h2>[/url]"; } } 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_clicks.php']<h2>Return to Courses page</h2>[/url]"; } $h->endpage(); ?> and the working cron: <?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 users SET taken=0 WHERE course > 0"); $q=$db->query("SELECT * FROM users WHERE cclicks=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM course WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursedone 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 cclicks=0"); ?> -
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
jds137 replied to Uridium's topic in Free Modifications
Re: [mccodes v2] Advanced Schooling includes days, clicks, money or crystals #1 add this to your DB: CREATE TABLE IF NOT EXISTS `course` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crDAYS` int(11) NOT NULL default '0', `crSTR` int(11) NOT NULL default '0', `crGUARD` int(11) NOT NULL default '0', `crLABOUR` int(11) NOT NULL default '0', `crAGIL` int(11) NOT NULL default '0', `crIQ` int(11) NOT NULL default '0', `crCLICKS` int(11) NOT NULL default '0', `crTOKENS` int(11) NOT NULL default '0', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; -- -- Dumping data for table `course` -- INSERT INTO `course` (`crID`, `crNAME`, `crDESC`, `crCOST`, `crENERGY`, `crDAYS`, `crSTR`, `crGUARD`, `crLABOUR`, `crAGIL`, `crIQ`, `crCLICKS`, `crTOKENS`) VALUES (19, 'Iron Man Workout', 'Here is a total body workout.', 1000, 0, 25, 0, 30, 150, 150, 150, 150, 150); Then add this code: schooling.php <?php include "globals.php"; // If you want it so anyone can use this modification remove the next 4 lines $_GET['ID']=abs((int) $_GET['ID']); $_GET['PAID']=abs((int) $_GET['PAID']); if(!$ir['donatordays']) { echo 'Invalid Command. Only donators can access this area. >[url="index.php"]Go Home[/url]'; $h->endpage(); exit; } if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM course WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); print " You are currently doing the <h1>{$coud['crNAME']}</h1> course, you have <h1>{$ir['cdays']}</h1> DAYS remaining."; } else { if($_GET['cstart']) { $_GET['cstart'] = abs((int) $_GET['cstart']); //Verify. $cd=$db->query("SELECT * FROM course WHERE crID={$_GET['cstart']}"); if($db->num_rows($cd) == 0) { print "You are trying to start a non-existant course!"; } else { $coud=$db->fetch_row($cd); $cdo=$db->query("SELECT * FROM coursedone WHERE userid=$userid AND courseid={$_GET['cstart']}"); if($ir['money'] < $coud['crCOST']) { print " <h1>You don't have enough money to start this course.</h1> [url='schooling.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } if($ir['tokens'] < $coud['crTOKENS']) { print " <h1>You don't have enough Tokens to start this course.</h1> [url='schooling.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print " <h1>You have already done this course.</h1> [url='schooling.php']Return to Previous Page</h2>[/url]"; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['cstart']},cdays={$coud['crDAYS']},cclicks={$coud['crCLICKS']},money=money-{$coud['crCOST']},tokens=tokens-{$coud['crTOKENS']} WHERE userid=$userid"); print " You have started the <h2>{$coud['crNAME']}</h2> course, it will take <h2>{$coud['crCLICKS']}</h2> CLICKS or <h2>({$coud['crDAYS']})</h2> DAYS to complete."; } } else { //list course print " <h1>Here is a list of available course.</h1>"; $q=$db->query("SELECT * FROM course"); print " <table width=75% cellspacing=1 class='table' border-color='#dedede'><tr style='background:gray;'><th>Course</th><th> Description</th><th> Cost</th><th> Tokens</th><th> Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursedone WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='schooling.php?cstart={$r[']Take[/url]"; } print " <tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td> {$r['crTOKENS']}</td><td> $do</td></tr>"; } print "</table>"; } } $h->endpage(); exit; print "<h3>Mobs Life Traders Academy</h3>"; $cn=$db->query("SELECT taken FROM users WHERE userid=$userid"); $taken=$db->fetch_row($cn); if($taken['taken'] > 0) { die(" Your clicks have not been Renewed yet.. <h1> Sorry come back later</h1> Clicks Remaining,,,<h1>{$ir['cclicks']}</h1>"); } { if($ir['cclicks'] > 0) $ce=$db->query("SELECT cclicks='{$happy['cclicks']}' FROM users WHERE userid=$userid"); $happy=$db->fetch_row($ce); $cd=$db->query("SELECT * FROM course WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET cclicks=cclicks-1 WHERE userid=$userid"); $db->query("UPDATE users SET taken=1 WHERE userid=$userid"); print " You currently have <h1>{$ir['cclicks']}</h1> CLICKS Left before this Tutition has completed. [url='schooling.php']<h3>Take This course</h3>[/url]"; $h->endpage(); exit; } $h->endpage(); ?> -
mccode-v2 Advanced Schooling includes days, clicks, money or crystals
jds137 replied to Uridium's topic in Free Modifications
My Modification of Illusions Modification Ok all, I went and modified this mod, to work with education as it is now. That way if you want you can have 2 education systems. 1 donator, and 1 non donator. Please check www.mobslife.net for the working version. First of all, leave your education alone, and do not add the following crons: ALTER TABLE `courses` ADD `crCRYSTALS` INT( 11 ) NOT NULL DEFAULT '0' , ALTER TABLE `courses` ADD `crCLICKS` INT( 11 ) NOT NULL DEFAULT '0' ; Also do not make the file called staff_courses.php Follow the steps outlined here and you will be just fine. With both working. -
Re: [mccode v1] New Jobs +1 for you. I used it, and even recoded it, to fit all the different things I have added to my jobs. Works 100%
-
Re: [mccode V2} Web Templates Converted I am looking forward to them, I have been looking for something like this for a while.
-
Re: [mccode v2] Shop Picture Try this: <td>[img=images/{$r[]</td> If you rid of the description box, this will pull the data from your DB, when the mouse hovers over it. Also you can make the pics any size.
-
Re: Needed... v2 forums sql queries for the db As for forums, why not illusions, it seems to be the best choice so far. I am sure MC3 will probable have some form of it too. lol
-
Re: Question on game stats? Then I should write a code, so my NPC stats do not count then?
-
Why in the MC2 version, do the stats not match up? Does anyone have a fix for this? I see it on alot of sites as well. This is on my home page: Now my gym:
-
Re: [mccode v2] User Search Ok the php was brought up. Can anyone really do it, or it it alot of hot air being blown around?
-
Re: [mccode v2] Display Cabinet Parse error: syntax error, unexpected T_ELSE in /home/ml/public_html/display.php on line 77