
septrax
Members-
Posts
31 -
Joined
-
Last visited
Never
septrax's Achievements
Newbie (1/14)
0
Reputation
-
Re: Got some issue when creating job Hmm sorry about this but im not really sure were i have looked trough the code but cant see were it missing :/ Here is my file my friend tooked a closer look but was a bit in a rush so he couldent help me so much :( Anyhow thansk for help :) staff_jobs.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case 'newjob': newjob(); break; case 'jobedit': jobedit(); break; case 'newjobrank': newjobrank(); break; case 'jobrankedit': jobrankedit(); break; case 'jobdele': jobdele(); break; case 'jobrankdele': jobrankdele(); break; default: print "Error: This script requires an action."; break; } function newjob() { global $db,$ir,$userid; if ( $_POST['jNAME']) { $db->query("INSERT INTO jobs VALUES('','{$_POST['jNAME']}', 0, '{$_POST['jDESC']}', '{$_POST['jOWNER']}')"); $i=$db->insert_id(); $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', $i, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); $j=$db->insert_id(); $db->query("UPDATE jobs SET jFIRST=$j WHERE jID=$i"); print "Job created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjob' method='post'> [b]Job Name:[/b] <input type='text' name='jNAME' /> [b]Job Description:[/b] <input type='text' name='jDESC' /> [b]Job Owner:[/b] <input type='text' name='jOWNER' /> <hr>[b]First Job Rank:[/b] [b]Rank Name:[/b] <input type='text' name='jrNAME' /> [b]Pays:[/b] <input type='text' name='jrPAY' /> [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' name='jrIQN' size=5 maxlength=5> <input type='submit' value='Create Job' /></form> EOF; } } function jobedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobs SET jNAME='{$_POST['jNAME']}', jDESC='{$_POST['jDESC']}', jOWNER='{$_POST['jOWNER']}', jFIRST={$_POST['jFIRST']} WHERE jID={$_POST['jID']}"); print "Job updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobs WHERE jID={$_POST['jID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input type='hidden' name='stage2' value='1'> <input type='hidden' name='jID' value='{$_POST['jID']}'> [b]Job Name:[/b] <input type='text' name='jNAME' value='{$r['jNAME']}'> [b]Job Description:[/b] <input type='text' name='jDESC' value='{$r['jDESC']}'> [b]Job Owner:[/b] <input type='text' name='jOWNER' value='{$r['jOWNER']}'> [b]First Job Rank:[/b] EOF; print jobrank_dropdown($c,'jFIRST',$r['jFIRST']); print <<<EOF <input type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobedit' method='post'> <input type='hidden' name='stage1' value='1'> Select a job to edit. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input type='submit' value='Edit Job' /> </form> EOF; } } function newjobrank() { global $db,$ir,$userid; if ( $_POST['jrNAME']) { $db->query("INSERT INTO jobranks VALUES('', '{$_POST['jrNAME']}', {$_POST['jrJOB']}, {$_POST['jrPAY']}, {$_POST['jrIQG']}, {$_POST['jrLABOURG']}, {$_POST['jrSTRG']}, {$_POST['jrIQN']}, {$_POST['jrLABOURN']}, {$_POST['jrSTRN']})"); print "Job rank created! "; } else { print <<<EOF <form action='staff_jobs.php?action=newjobrank' method='post'> [b]Rank Name:[/b] <input type='text' name='jrNAME' /> [b]Pays:[/b] <input type='text' name='jrPAY' /> [b]Job:[/b] EOF; print job_dropdown($c,"jrJOB", -1); print <<<EOF [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3> IQ: <input type='text' name='jrIQG' size=3 maxlength=3> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5> IQ: <input type='text' name='jrIQN' size=5 maxlength=5> <input type='submit' value='Create Job Rank' /></form> EOF; } } function jobrankedit() { global $db,$ir,$userid; if ( $_POST['stage2']) { $db->query("UPDATE jobranks SET jrNAME='{$_POST['jrNAME']}', jrJOB = {$_POST['jrJOB']}, jrPAY= {$_POST['jrPAY']}, jrIQG={$_POST['jrIQG']}, jrLABOURG={$_POST['jrLABOURG']}, jrSTRG={$_POST['jrSTRG']}, jrIQN={$_POST['jrIQN']}, jrLABOURN={$_POST['jrLABOURN']}, jrSTRN={$_POST['jrSTRN']}WHERE jrID={$_POST['jrID']}"); print "Job rank updated! "; } else if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $r=$db->fetch_row($q); print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input type='hidden' name='stage2' value='1'> <input type='hidden' name='jrID' value='{$_POST['jrID']}'> [b]Job Rank Name:[/b] <input type='text' name='jrNAME' value='{$r['jrNAME']}'> [b]Job:[/b] EOF; print job_dropdown($c,'jrJOB',$r['jrJOB']); print <<<EOF [b]Pays:[/b] <input type='text' name='jrPAY' value='{$r['jrPAY']}' /> [b]Gains:[/b] Str: <input type='text' name='jrSTRG' size=3 maxlength=3 value='{$r['jrSTRG']}'> Lab: <input type='text' name='jrLABOURG' size=3 maxlength=3 value='{$r['jrLABOURG']}'> IQ: <input type='text' name='jrIQG' size=3 maxlength=3 value='{$r['jrIQG']}'> [b]Reqs:[/b] Str: <input type='text' name='jrSTRN' size=5 maxlength=5 value='{$r['jrSTRN']}'> Lab: <input type='text' name='jrLABOURN' size=5 maxlength=5 value='{$r['jrLABOURN']}'> IQ: <input type='text' name='jrIQN' size=5 maxlength=5 value='{$r['jrIQN']}'> [b]Job:[/b] <input type='submit' value='Edit' /> </form> EOF; } else { print <<<EOF <form action='staff_jobs.php?action=jobrankedit' method='post'> <input type='hidden' name='stage1' value='1'> Select a job rank to edit. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input type='submit' value='Edit Job Rank' /> </form> EOF; } } function jobrankdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $q=$db->query("SELECT * FROM jobranks WHERE jrID={$_POST['jrID']}"); $jr=$db->fetch_row($q); $_POST['jID']=$jr['jrJOB']; $db->query("DELETE FROM jobranks WHERE jrID={$_POST['jrID']}"); print "Job rank successfully deleted! "; $db->query("UPDATE users u LEFT JOIN jobs j ON u.job=j.jID SET u.jobrank=j.jFIRST WHERE u.job={$_POST['jID']} and u.jobrank={$_POST['jrID']}"); $q=$db->query("SELECT * FROM jobs WHERE jFIRST={$_POST['jrID']}"); if($db->num_rows($q)) { $r=$db->fetch_row($q); print "[b]Warning![/b] The Job {$r['jNAME']} now has no first rank! Please go edit it and include a first rank. "; } } else { print <<<EOF <form action='staff_jobs.php?action=jobrankdele' method='post'> <input type='hidden' name='stage1' value='1'> Select a job rank to delete. EOF; print jobrank_dropdown($c, 'jrID', -1); print <<<EOF <input type='submit' value='Delete Job Rank' /> </form> EOF; } } function jobdele() { global $db,$ir,$userid; if ( $_POST['stage1']) { $db->query("DELETE FROM jobs WHERE jID={$_POST['jID']}"); print "Job rank successfully deleted! "; $db->query("DELETE FROM jobranks WHERE jrJOB={$_POST['jID']}"); print mysql_affected_rows()." job ranks deleted. "; $db->query("UPDATE users SET job=0,jobrank=0 WHERE job={$_POST['jID']}"); } else { print <<<EOF <form action='staff_jobs.php?action=jobdele' method='post'> <input type='hidden' name='stage1' value='1'> Select a job to delete. EOF; print job_dropdown($c, 'jID', -1); print <<<EOF <input type='submit' value='Delete Job' /> </form> EOF; } } function report_clear() { global $db,$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(); ?>
-
Re: Last thing before i host my game wow many respons really appriciate it :) oh lol so i just forgott that code well easy then thanks for the help everybody:P
-
Hi again I have worked on my game for a long time to get it so good i can pretty much out off ideas now but i can say you can do very much in game all from make your own boost,drug to rob banks,steal cars,become loneshark and so on The only thing i have left is my cron i think its the worst part lol i just need them to run liek they should have everythign i need to run them I set myself in jail for 5 minutes i run www.mydomain.com/cron_minute.php But it says 5 minutes all the time :/ Do i run it wrong or is it wrong coded in the cron file what you think and do i need to post the cron file ? :P Thanks for the answers little exitet to host it after all work its finally so close to get hosted
-
Hi I moved my game to another server a few minutes ago and i think i messeup up something with the job sql After i moved my game i added some new stuff no problems at all until i was adding a few new job i saw i got some sql error wic i did not get before :/ SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , , , , , )' at line 1 Query was INSERT INTO jobranks VALUES('', '', 2, , , , , , , ) I have no idea what could make this worked perfect before :( So does anybody have any idea what i can do to fix it ? Thanks
-
Re: Omg i just made best move ever not Delete twice ? deleted it! dident say i deleted it more then 1 time :/ Why spend 300$ on host when i got my own dedicated server ? Cant code ? Did i say i cant code ? I cant code so good still learning Dont have game becuse i cant code ? Wtf is that about ? How do u think ppl learn ? Just forgett this its alredy solved
-
Re: Cron Setup No i cant just type in the url and try the game becuse i need to test if the crons are right and like i said 2 times now i found a post that i could point my url to something and then the long code in congif and i would see if it worked but no i cant find that post so never mind instead i look until i find it so problem solved
-
Re: Cron Setup Well the crons i alredy have i just need to test so my cron setup work And as is said i saw someone post how to test it but now i cant find the post again
-
Re: Cron Setup Ok so my cron should work now not sure tought i saw one posted how to tets but i cant find the post again Was something with the ulr to the cron file and then the long code that are in config does anybody understand what i mean ? Do i test it that way ?
-
Re: Cron Setup wow ok thanks i will look around more then :)
-
Hi everybody I need some help to setup cron I have tested it works without any problems if i run it manuall But i want them to run automatic ofc Everything is hosted on my own server so i have no cpanel Any idea how to get it work ?
-
Re: Omg i just made best move ever not omg i do but if you read my post above before you posted you would know why i dident want to copy the orginal one
-
Re: Xp problem Ok cool i will try a few different :P Thank you for your help
-
Re: Xp problem Ok so if i got it right this will give less xp ? ((WILL*1.0)/10) Or im wrong ?
-
Re: Xp problem Yeah thanks you it worked i went from lvl 1 to lvl 2 and got 76% xp lol Do you have a few suggestions on a few formulas ? :)
-
Re: Xp problem Ok i will try right away brb in a few sqcond hope it works :) Thx