-
Posts
2,140 -
Joined
-
Last visited
-
Days Won
148
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Re: MCcode V1.1 New Jobs[Free] Converted to v2 (and fixed for errors that may show up if you have a secure server) <?php include "globals.php"; $_GET['interview'] = isset($_GET['interview']) && is_string($_GET['interview']) && preg_match("`^\d+$`ims", $_GET['interview']) ? @intval($_GET['interview']) : 0; if(!$ir['job']) { if(!$_GET['interview']) { print " <font size='2'>NOTE:If any of the 'Req' fields are <font color=green>Green</font> it means that you have reached the required stat you need. However if any of the 'Req' fields are <font color=red>Red</font> it means that you need to more training on that particular stat.</font> Hi, looks like you don't have a job yet, here are the jobs you can get. <table width='100%' class='coll' border='1'> <Tr background='theader.gif'> <th background='theader.gif'>Job Name</th> <th background='theader.gif'>Job Desc</th> <th background='theader.gif'>Req Strength</th> <th background='theader.gif'>Req Labour</th> <th background='theader.gif'>Req IQ</th> <th background='theader.gif'>Get</th> </tr>"; $q=$db->query("SELECT j.*,jr.* FROM jobs j LEFT JOIN jobranks jr ON j.jFIRST = jr.jrID"); while($r=$db->fetch_row($q)) { print "<tr bgcolor='black'> <td>{$r['jNAME']}</td> <td>{$r['jDESC']}</td><td>"; if($ir['strength'] < $r['jrSTRN']) { print "<font color=red>{$r['jrSTRN']}</font>"; } else { print "<font color=green>{$r['jrSTRN']}</font>"; } echo "</td><td>"; if($ir['labour'] < $r['jrLABOURN']) { print "<font color=red>{$r['jrLABOURN']}</font>"; } else { print "<font color=green>{$r['jrLABOURN']}</font>"; } echo "</td><td>"; if($ir['IQ'] < $r['jrIQN']) { print "<font color=red>{$r['jrIQN']}</font>"; } else { print "<font color=green>{$r['jrIQN']}</font>"; } echo "</td> <td>[url='job.php?interview={$r[']Get Job[/url]</td> </tr> "; } print "</table>"; } else { $q=$db->query("SELECT j.*,jr.* FROM jobs j LEFT JOIN jobranks jr ON j.jFIRST = jr.jrID WHERE j.jID={$_GET['interview']}"); $r=$db->fetch_row($q); if($ir['strength'] >= $r['jrSTRN'] && $ir['labour'] >= $r['jrLABOURN'] && $ir['IQ'] >= $r['jrIQN']) { $db->query("UPDATE users SET job={$_GET['interview']},jobrank={$r['jrID']} WHERE userid=$userid;"); print "<font color=green>[b]Congratulations you got the job! [url='job.php']<u>>Go To Your Job</u>[/url]"; } else { print "<font color=red>Sorry but you are not good enough to get this job, you need:"; if($ir['strength'] < $r['jrSTRN']) { $s=$r['jrSTRN']-$ir['strength']; print " $s more Strength,"; } if($ir['labour'] < $r['jrLABOURN']) { $s=$r['jrLABOURN']-$ir['labour']; print " $s more Labour,"; } if($ir['IQ'] < $r['jrIQN']) { $s=$r['jrIQN']-$ir['IQ']; print " $s more IQ, "; } print "to get the job. [url='index.php']<u>Back Home</u>[/url]"; } } } else { switch($_GET['action']) { case 'quit': quit_job(); break; case 'promote': job_promote(); break; default: job_index(); break; } } function job_index() { global $db,$ir,$userid,$h; print "<h3>Your Job</h3> You currently work in the {$ir['jNAME']}! You receive \${$ir['jrPAY']} each day at 5pm! You also receive {$ir['jrIQG']} IQ, {$ir['jrSTRG']} strength, and {$ir['jrLABOURG']} labour! <table width=50%><tr><td>Strength: {$ir['strength']}</td><td>IQ: {$ir['IQ']}</td></tr><tr><td>Labour: {$ir['labour']}</td><td>Job Rank: {$ir['jrNAME']}</td></tr></table> [b]Job Ranks[/b] <table width=75%><tr style='background:gray'><th>Title</th><th>Pay</th><th>Strength Reqd</th><th>IQ Reqd</th><th>Labour Reqd</th></tr>"; $q=$db->query("SELECT * FROM jobranks WHERE jrJOB={$ir['job']} ORDER BY jrPAY ASC;"); while($r=$db->fetch_row($q)) { print "<tr><td>{$r['jrNAME']}</td><td>\${$r['jrPAY']}</td><td>{$r['jrSTRN']}</td><td>{$r['jrIQN']}</td><td>{$r['jrLABOURN']}</td></tr>"; } print "</table> [url='job.php?action=promote'] Try To Get Promoted[/url] [url='job.php?action=quit'] Quit[/url]"; } function job_promote() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM jobranks WHERE jrPAY > {$ir['jrPAY']} AND jrSTRN <= {$ir['strength']} AND jrLABOURN <= {$ir['labour']} AND jrIQN <= {$ir['IQ']} AND jrJOB = {$ir['job']} ORDER BY jrPAY DESC LIMIT 1"); if($db->num_rows($q) == 0) { print "Sorry, you cannot be promoted at this time. [url='job.php'] Back[/url]"; } else { $r=$db->fetch_row($q); $db->query("UPDATE users SET jobrank={$r['jrID']} WHERE userid=$userid"); print "Congrats, you have been promoted to {$r['jrNAME']} [url='job.php'] Back[/url]"; } } function quit_job() { global $db,$ir,$userid,$h; $db->query("UPDATE users SET job=0,jobrank=0 WHERE userid=$userid"); print "You have quit your job! [url='job.php'] Back[/url]"; } $h->endpage(); ?>
-
Re: [mccode] jail/hosp shoutbox It works for both versions.. But it is still hackable.. You are able to use an HTML injection in that.. I can't remember how it was fixed. But Nyna knows as she provided me with the anti-hack
-
[mccode] BLIP Tables (Blocked IPv4 Addresses by CIDR)
Magictallguy replied to a topic in Free Modifications
Re: Free 2 - BLIP Tables (Blocked IPv4 Addresses by CIDR) My host doesn't actually have an "htdocs" folder... -
Re: Possible Exploit Fix v1 or v2? (For those that don't know (such as myself :P))
-
Re: Scrolling You could've Googled that..
-
Re: [Free] MySQL Control Panel Any chance you could add an "ALTER TABLE" function into there please? I've tried and failed...repeatedly!
-
Re: User Rating Hehe, you people...Sometimes you make me laugh.. I'll post up a MySQL setup manual later..
-
Re: Secure Your Crons. Yup it does :P
-
Re: Tutorial: v1 - v2 Conversion Ok, you know what you're doing...But we don't xD But I have 2 questions.. 1. Where would you put that? 2. Where would the query go inside of that?
-
Re: stop same ip transfers Nyna knows plenty...She could probably re-write the entire language.. :P Hi Nyna!
-
Re: Generate Password Well you've gotta hand it to Ghetto - He's very vigilant and did his research..
-
Re: Free service Good question Zaver... and I could easily do that too :P
-
Re: [V2] cars_mod staff_cars Hmm.. I wonder if you really did make this, or you found it somewhere else. Your english spelling is very different to "your" code... Still *if* you did make this, then well done.
-
Re: Randomizing users Hahaha! That's brilliant!
-
Re: [V2] Staff Items That really has helped and yes, I was getting the same error! :P
-
Re: cityes v2 You wouldn't happen to be Dylan would you?
-
Re: Optimize generation You do realise that what you are doing is a breach of the Data Protection Act? - Basically, you're breaking the law!
-
Re: [V2] Staff Items I've updated it to what you said..Still isn't having it.. :( function kill_itemtype_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item Type</h3> The item type will be permanently removed from the game. <form action='staff_items.php?action=killitemtypesub' method='post'> Item Type: ".itemtype_dropdown($c,'itmtype')." <input type='submit' value='Kill Item Type' /></form>"; } function kill_itemtype_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM itemtypes WHERE itmtypeid={$_POST['itmtypeid']}"); print "The item type {$itemi['itmtypename']} was removed from the game."; stafflog_add("Deleted item type {$itemi['itmtypename']}"); }
-
Re: [V2] Staff Items Ah yea.. Right there in front of me! xD - Thanks!
-
Re: Casino with slots [V2] Last 2
-
Re: Casino with slots [V2] More! 7 and 7i are the same number but different styles..
-
Re: Casino with slots [V2] Here's the images I've just made - Not perfect though....
-
Re: Quantify Mod for V2! I retract my previous post...I had somehow misspelt $currdel with urrdel O_o
-
Re: Quantify Mod for V2! Well it still doesn't like the code... <?php include "globals.php"; $used=array(); $q=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid"); while ( $r=$db->fetch_row($q) ) { if ( ! in_array ( $r['inv_id'], $used ) ) { $currdel=array(); $used[] =$r['inv_id']; $currdel[]=$r['inv_id']; $amount=$r['inv_qty']; //grab sellers others $q2=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid = {$r['inv_itemid']} AND inv_id != {$r['inv_id']}"); while ( $r2 = $db->fetch_row($q2) ) { $used[]=$r2['inv_id']; $currdel[]=$r2['inv_id']; $amount+=$r2['inv_qty']; } $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(","urrdel).")"); $db->query("INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount)"); print "$amount of item id {$r['inv_itemid']} quantified... "; } } print "[b]<font color='red'>Quantifying Done</font>[/b] <hr width=50%><center><a href=inventory.php>>Back to your Items</a> <hr width=50%>"; $h->endpage(); ?> Error is on line 19: $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(","urrdel).")"); Doesn't like that: Parse error: syntax error, unexpected T_STRING in /quantify.php on line 19
-
Re: battlearena SQL: (Isomerisers...so I don't know why I'm posting it again..) CREATE TABLE `battlearena` ( `batid` int(11) NOT NULL auto_increment, `p1` int(11) NOT NULL default '0', `p2` int(11) NOT NULL default '0', `p3` int(11) NOT NULL default '0', `p4` int(11) NOT NULL default '0', `p5` int(11) NOT NULL default '0', `p6` int(11) NOT NULL default '0', `p7` int(11) NOT NULL default '0', `p8` int(11) NOT NULL default '0', `p9` int(11) NOT NULL default '0', `p10` int(11) NOT NULL default '0', `lastwinner` int(11) NOT NULL default '0', PRIMARY KEY (`batid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;