-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling can you set me up an admin account on your game and PM me the details I wont Messwith anything other than the schooling. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling yeah that can be done also i didnt add hp or brave as my desicion was that people would just abuse the system for their own gains. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling in the admin panel when adding a new course you must specify an item from the list you want to use as a prize. i did test this about 20 times before i made it public and it worked every time. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Anyone using this mod! Can ya give me some feedback on its usuage, just really want to know if everythigs working and also if anyone had any further improvement ideas. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Cheers Cody :) reason i didnt add the links cos they come as standard on V2 which saved me a bit of time renaming them but thanks for pointing it out to other that may not have the links :) Yeah you can add the daily clicks to the cron_day i just like to create a file so i dont mes things up on the cron_day as its 24 hours before you realise you have a bug. :) -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling You will probably find some references in this script that seem weird example the table coursestarted never gets a mention in the script this is me being brain dead it will in future updates have a purpose but at the time i just wanted to finish it the script. so i thought id leave it in for now.... regards the $search You could probably do it the way you mentioned but i wanted to make sure it was right the first time round so i chose the harder method lol -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling Im still doing the crons sorry for the delay but Sleep got the better of me and i woke up with one of my daughters lollipops stuck to the side of me face ;) You will need an hourly cron so i suupose you could do this yourself by adding this to cron_hour.php $db->query("UPDATE users SET minus_clicks=0 WHERE userid=$userid"); $db->query("UPDATE users SET clickend=0 WHERE userid=$userid"); call this school_cron.php for the daily updates <?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 course_clicks=18 WHERE course_clicks < 18"); ?> -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling call this file education.php <?php include "globals.php"; print "<h2>Schooling</h2>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); if($ir['course_clicks'] >= 1) { $db->query("UPDATE users SET cpercent=cpercent+1, course_clicks=course_clicks-1, minus_clicks=minus_clicks+1, clickend=clickend+1 WHERE userid=$userid"); } if(isset($_GET['begin_course'])) { if($ir['course_clicks'] <= 0) { echo '<h2>Your tutor says your doing an excellent job but come back in an hour</h2> you have completed <h2>'.($ir['cpercent']).'% </h2> So far on this module'; exit($h->endpage()); } } if(isset($_GET['begin_course'])) { if($ir['minus_clicks'] >= 3) { echo '<h2>You have used your 3 valid tuition trains come back in an hour</h2>'; exit($h->endpage()); } } if ($ir['cpercent'] >= $coud['crCOMPPERCENT']) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); $db->query("UPDATE users SET money=money+'{$coud['crCASHPRIZE']}' WHERE `userid` = '$userid' "); item_add($ir['userid'], $coud['crITEM'], $coud['crQTY']); event_add($ir['userid']," you have completed the {$coud['crNAME']} module and your master says {$coud['crCOMPLETED']}!'",$c); $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); $db->query("UPDATE users SET `cpercent` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `clickend` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `course` = '0' WHERE userid=$userid"); $db->query("UPDATE users SET `minus_clicks` = '0' WHERE userid=$userid"); $db->query("UPDATE `coursesdone` SET `userid` = '{$userid}' WHERE `courseid` = '{$ir['course']}' "); print "[url='education.php?begin_course={$ir['] [ View your Gains ][/url] "; print "[url='education.php'][ Return to School ][/url] "; $q=$db->query("SELECT * FROM users WHERE cpercent=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"); } event_add($ir['userid']," you have completed the {$coud['crNAME']} module and gained $ev!'",$c); } exit; } echo ' <table border="1" width="100%" class="table" cellspacing="3" cellpadding="4"> <tr> <th>Course</th> <th>Cost</th> <th>Description</th> <th>Studying</th> <th>Take Lesson</th> <th>Percent</td> <th>Overall</td> <th>Clicks</td> </tr> <tr>'; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); { echo ' <td>'.$coud['crNAME'].'</td> <td>$'.$coud['crCOST'].'</td> <td>'.$coud['crDESC'].'</td> '; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); //if ($dn = mysql_num_rows($dt)) { echo ' <td>Yes</td> <td>Taking Lesson</td>'; } //else { echo ' <td><font color="green">'.($ir['cpercent']).'%</font></td> <td><a href=education.php?begin_course='.$coud['crID'].'>Study</a></td>'; } $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); echo ' <td>'.$ir['course_clicks'].'</td> </tr> <tr>'; } echo ' </tr> </table>'; if($ir['course_clicks'] <= 0) { echo ''; exit($h->endpage()); } // LEAVE BLANK } else { if($_GET['begin_course']) { $_GET['begin_course'] = abs((int) $_GET['begin_course']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['begin_course']}"); 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 coursesdone WHERE userid=$userid AND courseid={$_GET['begin_course']}"); if($ir['course_clicks'] > $coud['crCLICKS']) { print "You have used up your daily clicks come back tomorrow."; $h->endpage(); exit; } if($ir['minus_clicks'] > $coud['crPERCLICKS']) { print "You have used up your Session clicks come back in a hour."; $h->endpage(); exit; } if($ir['clickend'] > $ir['course_clicks']) { print "Stop trying to cheat."; $h->endpage(); exit; } if($ir['money'] < $coud['crCOST']) { print "You don't have enough money to start this course."; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print "You have already done this course."; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['begin_course']},cpercent={$coud['crPERCENT']},money=money-{$coud['crCOST']} WHERE userid=$userid"); print "You have started the {$coud['crNAME']}, {$coud['crSTARTING']} {$coud['crDESC']} [url='education.php?begin_course={$r[']CONTINUE[/url]"; } } else { //list courses print "Here is a list of available courses."; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Course</th><th>Description</th><th>Cost</th><th>% To Complete</th><th>Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='education.php?begin_course={$r[']Take[/url]"; } print "<tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td>{$r['crCOMPPERCENT']}%</td><td>$do</td></tr>"; } print "</table>"; } } $h->endpage(); ?> Now open up mainmenu.php look for $mc=$ir['new_mail']; top of page and underneath that add $course=$ir['minus_clicks']; Now remove this link School Locate these lines print "[url='announcements.php']Announcements ({$ir['new_announcements']})[/url] "; } else { print "[url='announcements.php']Announcements (0)[/url] "; } And directly underneath add these if($course['minus_clicks'] < 3) { print "[url='education.php'][b]Continue Learning[/b][/url] "; } elseif ($course['minus_clicks'] = 0) { print "[url='education.php']Back To School[/b][/url] "; } Because this Doesnt need a cron to update the schooling you can either remove it from cron_day.php or just leave it... I'll post crons in a moment to update the clicks.. -
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling if your game already has the original schooling and users are still taking courses dont apply this script until they have all completed their schooling. ok SQLS CREATE TABLE IF NOT EXISTS `courses` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crSTARTING` text NOT NULL, `crCOMPLETED` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crCASHPRIZE` int(11) NOT NULL default '0', `crITEM` int(11) NOT NULL default '0', `crQTY` int(11) NOT NULL default '0', `crCOMPPERCENT` int(11) NOT NULL default '0', `crPERCENT` int(11) NOT NULL default '0', `crCLICKS` int(11) NOT NULL default '0', `crPERCLICKS` 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', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; AND CREATE TABLE IF NOT EXISTS `coursestarted` ( `userid` int(11) NOT NULL default '0', `courseid` int(11) NOT NULL default '0', `percent` int(11) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; And add these to your users table ALTER TABLE users ADD crpercent INT (11) NOT NULL default 0; ALTER TABLE users ADD course_clicks INT (11) NOT NULL default 18; ALTER TABLE users ADD minus_clicks INT (11) NOT NULL default 0; ALTER TABLE users ADD clickend INT (11) NOT NULL default 0; Call this file staff_courses.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']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $energy=abs((int) $_POST['energy']); $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'] && $cost && $cashprize && $item && $qty) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}', '$cost', '$cashprize', '$item', '$qty', '$energy', '$comppercent', '$percent', '$clicks', '$perclicks', '$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_courses.php?action=addcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <th>Course Name: <input type='text' name='name' /> </th> <th>Course Description: <input type='text' name='desc' /> </th> <th>Starting Text: <input type='text' name='starting' /> </th> <th>Completed Text: <input type='text' name='completed' /> </th> <th>Course Target Percent: <input type='text' name='compperent' /> example 100% - 10000% </th></tr> <th>Percent Gain: <input type='text' name='percent' /> Example 1 to 99999 </th> <th>Clicks Per Day: <input type='text' name='clicks' /> Example 18 </th> <th>Clicks Per Session: <input type='text' name='perclicks' /> Example 3 Per Session </th> <th>Cost (Money): <input type='text' name='cost' /> </th> <th>Cash Prize: <input type='text' name='cashprize' /> </th></tr> <th>Item Prize: <input type='text' name='item' /> Enter Inventory item ID </th> <th>Quantity: <input type='text' name='qty' /> </th> <th>Cost (Energy): <input type='text' name='energy' /> </th> <th>Strength Gain: <input type='text' name='str' /> </th> <th>Agility Gain: <input type='text' name='agil' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' /> </th> <th>Labour Gain: <input type='text' name='lab' /> </th> <th>IQ Gain: <input type='text' name='iq' /> </th> <input type='submit' value='Add Course' /></form></tr></table> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $comppercent=abs((int) $_POST['comppercent']); $percent=abs((int) $_POST['percent']); $clicks=abs((int) $_POST['clicks']); $perclicks=abs((int) $_POST['perclicks']); $cashprize=abs((int) $_POST['cashprize']); $item=abs((int) $_POST['item']); $qty=abs((int) $_POST['qty']); $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 courses SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crCASHPRIZE=$cashprize, crITEM=$item, crQTY=$qty, crENERGY=$energy, crCOMPPERCENT=$comppercent, crPERCENT=$percent, crCLICKS=$clicks, crPERCLICKS=$perclicks, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "<h1>Course $name was edited successfully.</h1> [url='staff_courses.php?action=addcourse'][ ADD ANOTHER COURSE ][/url] [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <table border='1' width='100%' class='table' cellspacing='3' cellpadding='4'> <tr> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['course']}' /> <th>Name: <input type='text' name='name' value='{$old['crNAME']}' /> </th> <th>Description: <input type='text' name='desc' value='{$old['crDESC']}' /> </th> <th>Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> </th> <th>Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> </th> <th>Course Target(percent): <input type='text' name='comppercent' value='{$old['crCOMPPERCENT']}' /> </th></tr> <th>Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> </th> <th>Clicks Per Day : <input type='text' name='clicks' value='{$old['crCLICKS']}' /> </th> <th>Clicks Per Session: <input type='text' name='perclicks' value='{$old['crPERCLICKS']}' /> </th> <th>Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> </th> <th>Cash Prize : <input type='text' name='cashprize' value='{$old['crCASHPRIZE']}' /> </th></tr> <th>Item Prize: ".item_dropdown($c,'item')." </th> <th>Quantity : <input type='text' name='qty' value='{$old['crQTY']}' /> </th> <th>Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> </th> <th>Strength Gain: <input type='text' name='str' value='{$old['crSTR']}' /> </th> <th>Agility Gain: <input type='text' name='agil' value='{$old['crAGIL']}' /> </th></tr> <th>Guard Gain: <input type='text' name='gua' value='{$old['crGUARD']}' /> </th> <th>Labour Gain: <input type='text' name='lab' value='{$old['crLABOUR']}' /> </th> <th>IQ Gain: <input type='text' name='iq' value='{$old['crIQ']}' /> </th> <input type='submit' value='Edit Course' /></form></tr></table> [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url]"; break; default: print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM courses WHERE crID={$_POST['course']}"); print "Course {$old['crNAME']} deleted."; stafflog_add("Deleted course {$old['crNAME']}"); } else { print "<h3>Deleting a Course</h3><hr /> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=delcourse'][ DELETE A COURSE ][/url] <form action='staff_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></form> [url='staff_courses.php?action=editcourse'][ EDIT A COURSE ][/url] [url='staff_courses.php?action=addcourse'][ ADD A COURSE ][/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_users.php?action=reportsview']> Back[/url]"; } $h->endpage(); ?> PART 2 BELOW -
Before i start i want to thank all those that have helped on this project. DAWG, TONKA, LITHIUM Ive made a few changes along the way from the previous one i posted so i'll throw up a few screenies for ya too look at whilst i get the script in order... THIS THREAD HAS BEEN UPDATED AND CAN BE FOUND HERE [mccode v2.x] [EDUCATION MOD] Totally Re-worked with many additional Options. [FINALLY COMPLETED CRONS AND SOME UPDATES]
-
Re: [MCCODES V2] New Schooling Advanced Ok i havent added the section that should Finish a course as my version just isnt working but the idea is when the Percent reaches that set by the set it should update and finish the course. FOOTNOTE This doesnt require a cron so the cron will need to be taken from cron_day.php and inserted into the education.php all mentions of cday should be called cpercent. minus_clicks SQL has no form at the moment but it should be that the admin sets the amount of clicks a user can use per session before they have to wait for they time out.. example 18 clicks are a daily total so the admin can set the minus clicks to say 3 so after 3 clicks they have to wait an hour to gain an extra 3 clicks.... Once the section has been completed for the Courses to update and finish that particular course i can start adding more features as promised.
-
Re: [MCCODES V2] New Schooling Advanced I'll post the whole thing for now which includes the admin section. for those that want to try remedy the problem.... SQLS CREATE TABLE IF NOT EXISTS `courses` ( `crID` int(11) NOT NULL auto_increment, `crNAME` varchar(255) NOT NULL default '', `crDESC` text NOT NULL, `crSTARTING` text NOT NULL, `crCOMPLETED` text NOT NULL, `crCOST` int(11) NOT NULL default '0', `crENERGY` int(11) NOT NULL default '0', `crPERCENT` 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', PRIMARY KEY (`crID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; And CREATE TABLE IF NOT EXISTS `coursestarted` ( `userid` int(11) NOT NULL default '0', `courseid` int(11) NOT NULL default '0', `percent` decimal(3,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; And ALTER TABLE users ADD course_clicks INT ( 11 ) default '18'; ALTER TABLE users ADD minus_clicks INT ( 11 ) default '0' ; ALTER TABLE users ADD cpercent INT (11 ) default '0'; call this staff_courses.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']); $energy=abs((int) $_POST['energy']); $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'] && $cost) { $db->query("INSERT INTO courses VALUES(NULL, '{$_POST['name']}', '{$_POST['desc']}', '{$_POST['starting']}', '{$_POST['completed']}','$cost', '$energy', '$percent', '$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_courses.php?action=addcourse' method='post'> Course Name: <input type='text' name='name' /> Course Description: <input type='text' name='desc' /> Starting Text: <input type='text' name='starting' /> Completed Text: <input type='text' name='completed' /> Percent Gain: <input type='text' name='percent' /> Example 1.2 or 2.1 Cost (Money): <input type='text' name='cost' /> Cost (Energy): <input type='text' name='energy' /> Strength Gain: <input type='text' name='str' /> Agility Gain: <input type='text' name='agil' /> Guard Gain: <input type='text' name='gua' /> Labour Gain: <input type='text' name='lab' /> IQ Gain: <input type='text' name='iq' /> <input type='submit' value='Add Course' /></form>"; } } function editcourse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $cost=abs((int) $_POST['cost']); $energy=abs((int) $_POST['energy']); $percent=abs((int) $_POST['percent']); $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 courses SET crNAME='$name', crDESC='{$_POST['desc']}', crSTARTING='{$_POST['starting']}', crCOMPLETED='{$_POST['completed']}', crCOST=$cost, crENERGY=$energy, crPERCENT=$percent, crSTR=$str, crGUARD=$gua, crLABOUR=$lab, crAGIL=$agil, crIQ=$iq WHERE crID={$_POST['id']}"); print "Course $name was edited successfully."; stafflog_add("Edited course $name"); break; case "1": $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); print "<h3>Editing a Course</h3><hr /> <form action='staff_courses.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']}' /> Starting Text: <input type='text' name='starting' value='{$old['crSTARTING']}' /> Completed Text: <input type='text' name='completed' value='{$old['crCOMPLETED']}' /> Percent Gain (percent): <input type='text' name='percent' value='{$old['crPERCENT']}' /> Cost (Money): <input type='text' name='cost' value='{$old['crCOST']}' /> Cost (Energy): <input type='text' name='energy' value='{$old['crENERGY']}' /> 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_courses.php?action=editcourse' method='post'> <input type='hidden' name='step' value='1' /> Course: ".course_dropdown($c, "course")." <input type='submit' value='Edit Course' /></form>"; break; } } function delcourse() { global $db,$ir,$c,$h,$userid; if($_POST['course']) { $q=$db->query("SELECT * FROM courses WHERE crID={$_POST['course']}"); $old=$db->fetch_row($q); $db->query("UPDATE users SET course=0, cpercent=0 WHERE course={$_POST['course']}"); $db->query("DELETE FROM courses 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_courses.php?action=delcourse' method='post'> Course: ".course_dropdown($c, "course")." <input type='submit' value='Delete Course' /></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(); ?> And call this education.php <?php include "globals.php"; print "<h2>Schooling</h2>"; if($ir['course'] > 0) { $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); if($ir['course_clicks'] >= 1) { $db->query("UPDATE users SET cpercent=cpercent+1, course_clicks=course_clicks-1, minus_clicks=minus_clicks+1 WHERE userid=$userid"); } if(isset($_GET['begin_course'])) { if($ir['course_clicks'] <= 0) { echo '<h2>Your tutor says your doing an excellent job but come back in an hour</h2> you have completed <h2>'.($ir['cpercent']).'% </h2> So far on this module'; exit($h->endpage()); } } echo ' <table border="1" width="100%" class="table" cellspacing="3" cellpadding="4"> <tr> <th>Course</th> <th>Cost</th> <th>Description</th> <th>Studying</th> <th>Take Lesson</th> <th>Percent</td> <th>Overall</td> <th>Clicks</td> </tr> <tr>'; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); { echo ' <td>'.$coud['crNAME'].'</td> <td>$'.$coud['crCOST'].'</td> <td>'.$coud['crDESC'].'</td> '; $cd=$db->query("SELECT * FROM courses WHERE crID={$ir['course']}"); $coud=$db->fetch_row($cd); //if ($dn = mysql_num_rows($dt)) { echo ' <td>Yes</td> <td>Taking Lesson</td>'; } //else { echo ' <td><font color="green">'.($ir['cpercent']).'%</font></td> <td><a href=education.php?begin_course='.$coud['crID'].'>Study</a></td>'; } $cd1=$db->query("SELECT cpercent, course_clicks FROM users WHERE userid=$userid"); $coud=$db->num_rows($cd1); echo ' <td>'.$ir['course_clicks'].'</td> </tr> <tr>'; } echo ' </tr> </table>'; if($ir['course_clicks'] <= 0) { echo ''; exit($h->endpage()); } // LEAVE BLANK } else { if($_GET['begin_course']) { $_GET['begin_course'] = abs((int) $_GET['begin_course']); //Verify. $cd=$db->query("SELECT * FROM courses WHERE crID={$_GET['begin_course']}"); 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 coursesdone WHERE userid=$userid AND courseid={$_GET['begin_course']}"); if($ir['money'] < $coud['crCOST']) { print "You don't have enough money to start this course."; $h->endpage(); exit; } if($db->num_rows($cdo) > 0) { print "You have already done this course."; $h->endpage(); exit; } $db->query("UPDATE users SET course={$_GET['begin_course']},cpercent={$coud['crPERCENT']},money=money-{$coud['crCOST']} WHERE userid=$userid"); print "You have started the {$coud['crNAME']}, {$coud['crSTARTING']} "; } } else { //list courses print "Here is a list of available courses."; $q=$db->query("SELECT * FROM courses"); print " <table width=75% cellspacing=1 class='table'><tr style='background:gray;'><th>Course</th><th>Description</th><th>Cost</th><th>Take</th></tr>"; while($r=$db->fetch_row($q)) { $cdo=$db->query("SELECT * FROM coursestarted WHERE userid=$userid AND courseid={$r['crID']}"); if($db->num_rows($cdo)) { $do="[i]Done[/i]"; } else { $do="[url='education.php?begin_course={$r[']Take[/url]"; } print "<tr><td>{$r['crNAME']}</td><td>{$r['crDESC']}</td><td>\${$r['crCOST']}</td><td>$do</td></tr>"; } print "</table>"; } } $h->endpage(); ?>
-
Re: Fluid and Fixed problem Maybe this will help you <html> <head> <title>Example</title> <style type="text/css"> div.header { position: absolute; top: 15px; padding: 10px; height: 50px; width: 100%; border: 1px dashed orange; } div.left { padding: 10px; position: absolute; left: 15px; top: 100px; width: 200px; height: 500px; border: 1px dashed orange; } div.center { padding: 10px; position: absolute; top: 100px; left: 250px; height: 500px; width: 500px; border: 1px dashed orange; } div.right { padding: 10px; position: absolute; right: 15px; top: 100px; width: 200px; height: 500px; border: 1px dashed orange; } div.footer { padding: 10px; position: absolute; right: 15px; top: 660px; height: 50px; width: 100%; margin: 20px; padding: 10px; border: 1px dashed orange; } </style> </head> <body> <div class="header"> PLACE ALL YOUR CODING FOR THE HEADER HERE </div> <div class="left"> PLACE ALL YOUR CODING FOR THE LEFT HTML HERE </div> <div class="center"> PLACE ALL YOUR CENTERED SCREEN HTML HERE </div> <div class="right"> PLACE ALL YOUR RIGHT HTML HERE </div> <div class="footer"> PLACE ALL THE FOOTER HTML HERE </div> </body> </html> demo http://www.freewebs.com/nightdreamer2000/divider.html One of my very firsts hosts lol ah bless em they were crap but did me well lol
-
Re: [MCCODES V2] New Schooling Advanced Ok time to say im having a few problems I cant get the stupid thing to update the SQLS when a course has reached 100% it just wants to carry on doing the course even though its exceeded 100%.
-
Re: [MCCODES V2] New Schooling Advanced Quick update im about 90% done on this now still some silly fiddley bits to add. That are driving me mental if i see another ELSE error im going to stab Dabomstew in the nose ;)
-
Still finishing this off but i thought id let you have a sneak preview before its made public..... DEMO GO TO SCHOOL LINK FIXED ADMIN FEATURES Whats it got then ? Admins no longer have to set the amount of days a course will finish it now works of Percentages. So for example.. You can set your Schooling to say 0.5% and each time the user clicks the educate link it will go up by 0.5% each time until it reaches 100% then the course has been finished. Aswell as setting a description for the Module you can now set up Other text events such as whats happening whilst your being educated + the final outcome text once the course is completed. You can still set up the usual abilities as with the old Course system but now you can decide wether to give an item as a reward or give cash as a reward for finshing the tuition. User End When your user starts a course they must be on your site for the education to finish rather than wait for the days to run out. They will receive 18 clicks per day to educate their given subject and as before this depends on what percentage you set the tuition up from the admin panel. Users have to wait 1 hour before they can click again and the info screen will tell them what their current status is.
-
Re: [mccode 2] another explore screenshot.
-
Re: [V2]New Explore It shouldnt take more than 2 mins to test a script. offline or online. It just gives people peace of mind that yuve put yourself out to clarify any errors before publishing.
-
Re: [V2]New Explore Sorry but why do people do that. Put things on here and then decide not to test it. This is probably a decent script and will probably work but for gods sake quit being lazy and test the thing before you add it on here.
-
Re: [mccode] Advanced Warning System have my copy cos i know this one works and if it dont work on yours then you have an error on another file... This version also includes the Event to inform a user.... THIS FOR THE V2 VERSION warnings.php <?php /*----------------------------------------------------- -- Mono Country v2.0 -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ include "globals.php"; if($ir['user_level'] > 2) { echo'You do not have the power to do this!'; $h->endpage();exit(); } switch($_GET['action']) { case 'add': addwarning(); break; case 'addsub': addwarning2(); break; case 'del': deletewarning(); break; case 'edit': editwarning(); break; case 'edit2': editwarning2(); break; default: index(); break; } function index() { global $ir,$userid,$db; print "<h3>Viewing Warnings For ID: <a href=viewuser.php?u={$_GET['user']}>{$_GET['user']}</a></h3> "; $q=$db->query("SELECT w.*,u.* FROM warnings w LEFT JOIN users u ON w.warner=u.userid WHERE w.user={$_GET['user']} ORDER BY w.time DESC"); print "<center><font color=red><h4>Total Warnings: ".$db->num_rows($q)." </font></h4> [<a href=warnings.php?action=add&userid={$_GET['user']}><font color=#DCDCDC>Add Warning</font></a>] <table width=90% border='1' align=center><tr><tr class='h'><td><font color=#DCDCDC>Warned By:</font></td><td width=40%><font color=#DCDCDC>Reason</font></td><td><font color=#DCDCDC>Date</font></td><td><font color=#DCDCDC>Links</font></td></tr>"; while($r=$db->fetch_row($q)) { $warned=date('F j, Y, g:i:s a',$r['time']); print "<tr><td><a href=viewuser.php?u={$r['userid']}>{$r['username']}</a></td><td>{$r['warnedfor']}</td><td>$warned</td><td>"; if($ir['userid'] == 1) { print "[<a href=warnings.php?action=del&ID={$r['id']}>Remove</a>] "; } if($ir['warner'] == $userid || $userid == 1) { print "[<a href=warnings.php?action=edit&ID={$r['id']}>Edit</a>]"; } print "</td></tr>"; }} function addwarning() { global $ir,$userid,$db; print "<form action=warnings.php?action=addsub method=post> <input style='visibility: hidden' name=user value={$_GET['userid']}> Reason: <textarea rows=7 cols=30 name=reason></textarea> <input type=submit value='Add warning'></form>"; } function addwarning2() { global $ir,$userid,$db; $_POST['user']=($_POST['user']); $_POST['reason']=($_POST['reason']); $db->query("INSERT INTO warnings VALUES ('','{$_POST['user']}','{$_POST['reason']}','$userid',unix_timestamp())"); $checkfed=$db->query("SELECT * FROM warnings WHERE user='{$_POST['user']}'"); if($db->num_rows($checkfed) > 2) { $db->query("UPDATE users SET fedjail=1 WHERE userid='{$_POST['user']}'"); $db->query("INSERT INTO fedjail VALUES('','{$_POST['user']}','300','$userid','Reached 3 warnings in game. Account jailed.')"); } print "Warning Added! [*]<a href=viewuser.php?u={$_POST['user']}>Back to users profile</a>"; event_add($_POST['user'],"You have received the Following Warning {$_POST['reason']}",$c); } function deletewarning() { global $ir,$userid,$db; if($ir['userid'] != 1) { die("Owner Only");} $db->query("DELETE FROM warnings WHERE id={$_GET['ID']}"); print "Warning Deleted"; } function editwarning() { global $ir,$userid,$db; $target=$_GET['ID']; $edit=$db->query("SELECT * FROM warnings WHERE id='$target'"); while($r=$db->fetch_row($edit)) { if($r['warner'] != $userid || $userid != 1) { die("You never set this warning, therefore cannot edit it"); } print "<h3>Edit Warning</h3> <form action=warnings.php?action=edit2 method=post> <input style='visibility: hidden;' name=id value=$target> <textarea rows=7 cols=30 name=reason>{$r['warnedfor']}</textarea> <input type=submit value='Edit Warning'></form>"; } } function editwarning2() { global $ir,$userid,$db; $db->query("UPDATE warnings SET warnedfor={$_POST['reason']} WHERE id={$_POST['id']}"); print "Warning Updated. [*]<a href=index.php>Home</a>"; } ?>
-
Re: [mccode] Advanced Warning System Someone asked me to include an EVENT when users get warning so heres the fix. open warnings.php find print "Warning Added! [*]<a href=viewuser.php?u={$_POST['user']}>Back to users profile</a>"; Directly underneath add. event_add($_POST['user'],"You have received the Following Warning {$_POST['reason']}",$c); Users who get warnngs will also receive an Event.
-
Stumbled Across this one by pure Accident and WOW its worth a look. Download site http://dragonprime.net/ Excellent scripts and a massive game very easy to install and comes with Masses of options for the user and staff.
-
[mccode] Diamond gems, with a Diamondtemple.php for v2.0
Uridium replied to MDK666's topic in Free Modifications
Re: [mccode] Diamond gems, with a Diamondtemple.php for v2.0 i wanted him to know what an epic fail that was I wish people would Bump my threads theyve been collecting dust for ages lol -
Re: Bank Layout V2 +1 Excellent addition its people like you that make Mcc better looking Graphicaly. Nicely created and a long over due addition. finaly added :)
-
[MCCODES V1 +V2] So who's viewing your profile
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V1 +V2] So who's viewing your profile Yep i just seen that I was testing it on an offline version with only me viewing UNTIL i uploaded it to someone elses game then saw it was my ID all the time.. So sorry guys Scrap this one if ya will