weewooz Posted August 17, 2009 Posted August 17, 2009 This will aloow users To Lose There jobs i thought i would post but please no moaning about saying i aint wriitin it its a free mod i took it off my old game files and wrote everything on there Ok Insert into your sql ALTER TABLE users ADD strikes INT(11) NOT NULL DEFAULT '0'; Then in authenticate.php find header("Location: loggedin.php"); add above $db->query("UPDATE users SET strikes=0 WHERE userid={$mem['userid']}"); Add This To Your Cron Day if($ir['strikes'] == 3) { $db->query("UPDATE users SET jobs=0, jobrank=0"); } Add This Also To Your cRon Day $db->query("UPDATE users SET strikes=strikes+1 WHERE strikes < 3"); in job.php Find 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 "{$r['jOWNER']}: Okay {$ir['username']}, we're good to go, see you tomorrow. {$ir['username']}: Thanks! [/url]"; } else { print "{$r['jOWNER']}: Sorry {$ir['username']}, you're not far enough in the game to work in this job. You'll 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 "before you'll be able to work here! "; } } } replace with $code=rand(0,20); if($ir['strikes'] >=3 && $code==10) { 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 "{$r['jOWNER']}: Okay {$ir['username']}, we're good to go, see you tomorrow. {$ir['username']}: Thanks! "; } else { print "{$r['jOWNER']}: Sorry {$ir['username']}, You can not get a job today try again tomorrow."; $h->endpage(); exit; } } else if($ir['strikes'] <=2 && $code !=10) { 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 "{$r['jOWNER']}: Okay {$ir['username']}, we're good to go, see you tomorrow. {$ir['username']}: Thanks! "; } else { print "{$r['jOWNER']}: Sorry {$ir['username']}, you're not far enough in the game to work in this job. You'll 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 "before you'll be able to work here! "; } } } } Still In Job.php Find function job_index() { global $db, $ir,$c,$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% cellspacing=1 class='table'><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> Job Ranks <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Title</th><th>Pay</th><th>Strength Reqd</th><th>IQ Reqd</th><th>Labour 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> > Try To Get Promoted > Quit"; } replace with function job_index() { global $db, $ir,$c,$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% cellspacing=1 class='table'><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> Job Ranks <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Title</th><th>Pay</th><th>Strength Reqd</th><th>IQ Reqd</th><th>Labour Reqd</th><th>Total Strikes</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><td>{$ir['strikes']}</td></tr>"; } print "</table> > Try To Get Promoted > Quit"; } Any Errors Please Post Quote
Magictallguy Posted August 22, 2009 Posted August 22, 2009 Re: Lose Your Job Wrap your code in code tags -.- Quote
wolfe Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job This will aloow users To Lose There jobs i thought i would post but please no moaning about saying i aint wriitin it its a free mod i took it off my old game files and wrote everything on there *sigh* Can we at least try to limit the bad spelling to one word per sentence? Periods would be nice too. Quote
POG1 Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job Add This To Your Cron Day if($ir['strikes'] == 3) { $db->query("UPDATE users SET jobs=0, jobrank=0"); } you sure thats gonna work.. Quote
weewooz Posted August 23, 2009 Author Posted August 23, 2009 Re: Lose Your Job well why not pog1 and sorry forgot tags :) Quote
POG1 Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job there is no where clause in ths sql so everyone in the database will loose their jobs :evil: Quote
Faz` Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job Damn, so if he took this off his old game files then everyone would lose there job every so often huh? Quote
wolfe Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job Well cron day does not use $ir... so it wouldnt have worked anyway. So according to his cron additions, the strikes just added up and no one ever lost their job. Quote
weewooz Posted August 23, 2009 Author Posted August 23, 2009 Re: Lose Your Job $db->query("UPDATE users SET strikes=strikes+1 WHERE strikes < 3"); Will that work then Quote
wolfe Posted August 23, 2009 Posted August 23, 2009 Re: Lose Your Job $db->query("UPDATE users SET strikes=strikes+1 WHERE strikes < 3"); Will that work then Work for? That adds a strike to people with less than 3 strikes. SO if that was what you are trying to do, then congrats, yes that part works. But the part we were talking about does not work. Quote
weewooz Posted August 23, 2009 Author Posted August 23, 2009 Re: Lose Your Job ok sorry got ya ill have alook now if anyone as any imout with cronjobs let us know ill have alook now and post what i get Quote
weewooz Posted August 23, 2009 Author Posted August 23, 2009 Re: Lose Your Job This Working for me in cron_day find $ids[]=$r['fed_userid']; } add below if($ir['strikes'] == 3) { $db->query("UPDATE users SET jobs=0, jobrank=0"); } works well on my game post if any errors Quote
weewooz Posted August 23, 2009 Author Posted August 23, 2009 Re: Lose Your Job maybe i should have been abit clearer in the first post where to put it but works fine here Quote
wolfe Posted August 24, 2009 Posted August 24, 2009 Re: Lose Your Job ummm and the people are losing their jobs? because the cron_day files i am familiar with do not use $ir. Quote
weewooz Posted August 24, 2009 Author Posted August 24, 2009 Re: Lose Your Job only think i cud get it to work and as things stands its working here Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.