KDawg08 Posted April 5, 2008 Posted April 5, 2008 I've got a custom Jail Bust script that runs a 50% chance of success at the moment. I am trying to get it so people can't use the bug... The bug is basically this: You can bust a user out and then refresh to keep busting them out even if they aren't in jail... This is the script I setup but doesn't work... Any suggestions? $dur=mysql_query("SELECT * FROM users WHERE userid={$_GET['bust']}",$c); if ($dur['jail']="0") { die("You cannot bust someone out of jail if they aren't in jail! <a href=jail.php>back</a>"); exit; } $_GET['bust'] = grabs userid of the user in jail. $dur being the user you're trying to bust outta jail. $dur['jail'] being the user you're trying to bust out's time left in jail... Quote
KDawg08 Posted April 5, 2008 Author Posted April 5, 2008 Re: Jail Bust Help FOUND OUT HOW TO DO IT ON MY OWN :) Here it is for anyone that might need/want it. $id = abs((int) $_GET['bust']); $z=mysql_query("SELECT * FROM users WHERE userid = $id",$c) or die(mysql_error()); $user = mysql_fetch_array($z); if(!$user['jail']) { print "Error: The player you selected is not in jail."; $h->endpage(); die(""); } Quote
Guest Anonymous Posted April 5, 2008 Posted April 5, 2008 Re: Jail Bust Help Well done and good to see you posting your solution. May I suggest that your query can be a lot smaller though... $sql = sprintf("SELECT `jail` FROM `users` WHERE (`userid` = %u)", $id); $z = mysql_query($sql, $c); No point in retrieving more information than you really need. Quote
KDawg08 Posted April 5, 2008 Author Posted April 5, 2008 Re: Jail Bust Help Thanks, and good way to put it as I am still a noob. just learning from other free mods and such! After i have an error and find the solution I like to give others the code that i did so they can learn from it also :) 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.