
Shakeynath
Members-
Posts
117 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Shakeynath
-
Job not giving stats or crediting users
Shakeynath replied to Shakeynath's topic in Modification Support
Fixed :) -
Job not giving stats or crediting users
Shakeynath replied to Shakeynath's topic in Modification Support
<?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 fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET reward_done=0"); $db->query("UPDATE users SET turns = 25 WHERE turns != 25"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $sql = sprintf("SELECT * FROM creditcard"); $sql = mysql_query($sql); while($get = mysql_fetch_array($sql)) { $limit = 1000000000000000; ///Set the top limit for the money aloud in credit cards, so they dont go in minus 0_o if($get['creditcard'] > 0) { $update = sprintf("UPDATE creditcard SET creditcard = creditcard + (creditcard/100*5) WHERE creditcard > 0 AND creditcard < $limit AND SAonoff = 'on'"); $update = mysql_query($update); } } $q=$db->query("SELECT * FROM users WHERE cdays=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"); } $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 cdays=0"); $db->query("TRUNCATE TABLE votes;"); $db->query("UPDATE users SET chatban=chatban-1 WHERE chatban > 0"); $db->query("UPDATE `users` SET rates=1"); ?> -
My job is not crediting my users, Is there a problem with my code ? I need help with this please :) Thanks <?php $jobquery=1; include "globals.php"; $_GET['interview'] = abs((int) $_GET['interview']); if(!$ir['job']) { if(!$_GET['interview']) { print "You do not yet have a job. A list of jobs is available below. "; $q=$db->query("SELECT * FROM jobs"); while($r=$db->fetch_row($q)) { print "> {$r['jNAME']} - {$r['jDESC']} - [url='job.php?interview={$r[']Go to interview[/url] "; } } 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); print "{$r['jOWNER']}: So {$ir['username']}, you were looking for a job with us? {$ir['username']}: Yes please! "; 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='job.php']:)[/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! [url='index.php']:'([/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,$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> [b]Job Ranks[/b] <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></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,$c,$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(); ?>
-
Yes ou did mate, I haven't had chance too make a reply lmaoo :) Cheers mate
-
Need the crons too ?
-
Okay i have changed it mate but the cron still wont work, When i do it manually it comes up a blank white screen but it doesnt lower anything in the game. Im still in my local school for one day and ive loaded the cron_day.php file over 10 times "/
-
What you mean bud ?
-
My cron day has just suddenly stopped working, Its running on a cron job but even when i manually do it it doesn't work. Its not truncating my vote table everyday or lowering the days down in school. My cron_day.php <?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 fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET turns = 25 WHERE turns != 25"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $sql = sprintf("SELECT * FROM creditcard"); $sql = mysql_query($sql); while($get = mysql_fetch_array($sql)) { $limit = 1000000000000000; ///Set the top limit for the money aloud in credit cards, so they dont go in minus 0_o if($get['creditcard'] > 0) { $update = sprintf("UPDATE creditcard SET creditcard = creditcard + (creditcard/100*5) WHERE creditcard > 0 AND creditcard < $limit AND SAonoff = 'on'"); $update = mysql_query($update); } } $q=$db->query("SELECT * FROM users WHERE cdays=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"); } $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 cdays=0"); $db->query("TRUNCATE TABLE votes;"); $db->query("UPDATE users SET chatban=chatban-1 WHERE chatban > 0"); $db->query("UPDATE 'users' SET rates=1"); $db->query("UPDATE users SET safetries = 10 WHERE safetries < 10"); ?>
-
Aint there one for a 60% or 70% chance of succeeding ? I need one so that its not too easy for them too succeed or not too easy to fail on the crimes "/ If you understand that lmaoo And no worries mate, I know what it feels like being tired :thumbdown:
-
I just took a look at the [mccode] Crime Count : A very simple mod that allows you to view your crimes succeeded, Crimes Failed & Total Crimes. I tried adding another one too my view user that shows users what current job i am on and also the rank name. Now i have added this too my view user Current Job: '.$r['job'].' But this only shows the job ID, How would i be able to change this too the actual name of the job ?
-
I don't understand what your saying mate lmaoo sorry :) I just want my players to have a 50/50 chance of doing crimes. This will only be for the lower crimes anyway, then i will increase the success to a higher percentage for the higher ones. Do you understand that lmaoo ;) Do you know the correct formula for 50/50 ??? Thanks buddy :)
-
Im a little stupid and thick lmaoo, Can you have a formula for 50/50 chance ?
-
That makes more sense mate, Thanks for sharing that because i wanted too know how to do it too :P
-
Thanks for that :)
-
O right mate, I'm not aware of those images to be from EVE "/ I had that template made by ishmell. I didn't come up with the images ! Thanks for that anyway
-
Hey peeps, Don't know whether this is the right forum i should be posting this on, If it is then i apologize for it :) The problem is that my staff menu layout is all over the place and doesn't look right :/ I have tried to sort this issue out for a while now but i cant get my head around it :( If i post a picture for you all to look at then maybe you could fix it if some of the coding is wrong or something :)
-
Thankyou for the feedback Derek :) I will take your feedback to improve the game ;) Any feedback is welcome both bad/good !
-
[align=center][/align] Hiya, I'm the owner and creator of a new browser based game. The game has only been live since 30/03/2010 and i have only just started too announce it in forums just like this one. We welcome everyone of all ages too join, we would like to make this game bigger than it is and we can only do that with the help off people like yourselves. Short description of the game ::: In the year 3045 people of earth were forced to fight for the leaders of evil and the government were unable to cope with the amount of violence that was happening. This is where you come into the equation, you were working for the government as the ministers bodyguard. You were the only one to be trusted to end this war between good and evil so you were ordered to be sent to outer space with a team for the search of peace. In this game you will be battling against other players to become the best ranked player on solarbattles. you will also be asked to get married by other players and share your allowance with them and work as a team to rule the solar system or be asked to join a clan and battle against other rival clans. Sign up and experience the true side of being a Solar battler by doing a variety of Different crimes, Attack or even Mug people from around the Globe to fight your way to be the best ranked member. Manage your strength, agility, Guard or even Read the Solar times newspaper. There is a lot more interesting stuff to do also but the only way you can find out is to sign up and Join the rest of the squadrons. Home page: http://solarbattles.co.uk/login.php Register: http://solarbattles.co.uk/register.php Thankyou :D
-
All files look correct :/
-
Someone has just messaged me saying that its going down not up :/
-
Hi all, Ive got a problem with my Exp bar, On all users it wont increase when doing crimes or attacking people. Is this a known problem that can be fixed ?
-
managed to get it too work after i replace {$set['game_marquee']} With <? print "{$set['game_marquee' ]}"; ?>
-
Add this code instead ! <hr color='#153E7E'> <MARQUEE bgcolor='#153E7E' loop=-5 scrollamount=4 width=100%><font color=red><font size=4> [b] <? print "{$set['game_marquee' ]}"; ?> [/b] </font></font></MARQUEE><hr color='#153E7E'> Just change colours to what you want ! Nice one tho mate im using it on my game atm :)
-
Problem ! I got told by a friend too check this out on my game. I added all the codes correctly too my site, Its shows up at the top of my pages were i want it too but the text doesn't change to what i type in the staff panel. It stays the same and it says {$set['game_marquee']} >>>> Ill post a screenie below. Have i missed something for it too come up like this ?