
PatterSon
Members-
Posts
12 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by PatterSon
-
Before I used to use notepad for html, however I've seen some programs where they have the line number on the side, which I believe would be great to find errors (at the moment I'm having to count down to find it xD). what free programs are there out there that are good? Thanks :)
-
Re: Attacking bug Hey thanks for that, worked great :).
-
I'm hoping someone can help me, I was messing about today, trying things out, and went to attack someone who was in fed, and it worked, which it really shouldn't have xD Does anyone know how to fix this? I'm not sure what I'm looking for really. Thanks to anyone who can help :)
-
Re: [Free] Log Suspicious Users I know this is a few pages ago, but I have a question. Where abouts do I put the code into 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 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"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) $db->query("UPDATE users SET log=log-1 WHERE log > 0",$c); { $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;"); ?> Any one able to help? Cheers. Edit - I've also ran into another problem. Line 7 is the one in bold. <?php include "sglobals.php"; //This contains general thingies switch($_GET['action']) { case 'basicset': basicsettings(); break; [b]case 'loguser': loguser(); break;[/b] case 'announce': announcements(); break; default: index(); break; // Log Suspicious Users Mod function loguser() { global $ir,$c,$h,$userid; echo '<h3>Log Suspicious Users</h3>'; Any ideas? Thanks.
-
Re: Exp doesn't work Yay, thanks so much for that :D.
-
Re: Exp doesn't work Ok, I'm either being really stupid (most likely) or its not there. <?php $macropage="gym.php"; include "globals.php"; if($ir['hospital']) { die("This page cannot be accessed while in hospital."); } $statnames=array( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'Labour' => 'labour'); $_POST['amnt']=abs((int) $_POST['amnt']); if(!$ir['jail']) { print "<h3>Gym</h3><hr />"; } else { print "<h3>Jail Gym</h3><hr />"; } if($_POST['stat'] && $_POST['amnt']) { $stat=$statnames[$_POST['stat']]; if(!$stat) { die("This stat cannot be trained."); } if($_POST['amnt'] > $ir['energy']) { print("You do not have enough energy to train that much.<hr />"); } else { $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { $gain+=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150); $ir['will']-=rand(1,3); if($ir['will'] < 0) { $ir['will']=0; } } if($ir['jail']) { $gain/=2; } $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid"); $inc=$ir[$stat]+$gain; $inc2=$ir['energy']-$_POST['amnt']; if($stat=="strength") { print "You begin lifting some weights. You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights. You now have {$inc} strength and {$inc2} energy left."; } elseif($stat=="agility") { print "You begin running on a treadmill. You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running. You now have {$inc} agility and {$inc2} energy left."; } elseif($stat=="guard") { print "You jump into the pool and begin swimming. You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming. You now have {$inc} guard and {$inc2} energy left."; } elseif($stat=="labour") { print "You walk over to some boxes filled with gym equipment and start moving them. You have gained {$gain} labour by moving {$_POST['amnt']} boxes. You now have {$inc} labour and {$inc2} energy left."; } print "<hr />"; $ir['energy']-=$_POST['amnt']; $ir[$stat]+=$gain; } } $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); print "Choose the stat you want to train and the times you want to train it. You can train up to {$ir['energy']} times.<hr /> <form action='gym.php' method='post'> Stat: <select type='dropdown' name='stat'> <option style='color:red;' value='Strength'>Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) <option style='color:blue;' value='Agility'>Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) <option style='color:green;' value='Guard'>Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) <option style='color:brown;' value='Labour'>Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) </select> Times to train: <input type='text' name='amnt' value='{$ir['energy']}' /> <input type='submit' value='Train' /></form>"; $h->endpage(); ?> I cant see anything that could be to do with Exp, am I missing it? Or is it not there?. Thanks.
-
Re: Exp doesn't work Ah I see, seems to be working now, although the exp gains are way to high at the moment xD. Although, the exp when going to the gym doesn't go up, any ideas?
-
Re: Exp doesn't work Hey, thanks for the reply. The formula that I had was already in the field, I added the one that you gave, and I didn't get any exp. This is the docrime.php file I have <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } } $h->endpage(); ?> I've only really just started php etc (within the last day or so), so its all pretty new to me, this started as something to mess about with in the holidays, and now its starting to annoy me that it wont work and I'm not sure why.
-
Hello, I'm having a few problems with getting crime exp to work, below is a screen print of what I have at the moment. What I'm having problems with, is when I succeed a crime, the exp bar doesn't go up, does anyone have any ideas on what I need to do? I'm guessing this would be in docrime.php if there was a error in the code? If someone can confirm this, I'll paste it here, as I dont want to paste it if its not that file etc. Thanks for any help that anyone can give :) Edit - It also doesn't go up when I go to the gym.
-
Sorry if this is in the wrong place, but I couldn't find a more suitable place. I've got McCode V2, but having a few problems, for example, when I train at the gym, the exp bar doesn't go up, as well as when I succeed a crime, I'm not sure about the success formula as well, could someone explain it to me? I understand the maths behind it, but not how it works. ((WILL*0.8)/2.5)+(LEVEL/4). Thanks for any help.