Jump to content
MakeWebGames

Assault

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by Assault

  1. Re: [mccode v2] New improved mailbox. Yes, I know, what is it supposed to be though?
  2. Re: [mccode v2] New improved mailbox. Alsmot runs on V1 but when i try to send a new message after i type it blah blah blah, when i click send i recive this error     <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); ?> <script type="text/javascript"> function insertSmiley(smiley) { var currentText = document.getElementById("message"); var smileyWithPadding = " " + smiley + " "; currentText.innerHTML += smileyWithPadding; } </script> <?php if($ir['mailban']) { echo '<font color="red">You have been mail baned for '.$ir['mailban'].' days. [b]Reason:[/b] '.$ir['mbreason']; $h->endpage(); exit; } $emos_toggle = <<<EOF [b]Note: Images are clickable.[/b] <table border="1" cellpacing="0" class="table" width="50%"> <tr> <th>Image</th> <th>Code</th> <th>Image</th> <th>Code</th> <th>Image</th> <th>Code</th> </tr> <tr> <td>[img=images/smileys/happy.gif]</td><td>:]</td> <td>[img=images/smileys/biggrin.gif]</td><td>:D</td> <td>[img=images/smileys/cool.gif]</td><td>:oo:</td> </tr> <tr> <td>[img=images/smileys/blink.gif]</td><td>O.o</td> <td>[img=images/smileys/dry.gif]</td><td>:/</td> <td>[img=images/smileys/angry.gif]</td><td>:angry:</td> </tr> <tr> <td>[img=images/smileys/huh.gif]</td><td>:?:</td> <td>[img=images/smileys/laugh.gif]</td><td>:lol:</td> <td>[img=images/smileys/mellow.gif]</td><td>:-:</td> </tr> <tr> <td>[img=images/smileys/ohmy.gif]</td><td>:O</td> <td>[img=images/smileys/sad.gif]</td><td>:(</td> <td>[img=images/smileys/ph34r.gif]</td><td>O.O</td> </tr> <tr> <td>[img=images/smileys/rolleyes.gif]</td><td>:roll:</td> <td>[img=images/smileys/sleep.gif]</td><td>:zzz:</td> <td>[img=images/smileys/smile.gif]</td><td>:)</td> </tr> <tr> <td>[img=images/smileys/tongue.gif]</td><td>:P</td> <td>[img=images/smileys/unsure.gif]</td><td>:S</td> <td>[img=images/smileys/wacko.gif]</td><td>:nut:</td> </tr> <tr> <td>[img=images/smileys/wink.gif]</td><td>;)</td> <td>[img=images/smileys/wub.gif]</td><td>:heart:</td> <td>[img=images/smileys/XD.gif]</td><td>XD</td> </tr> </table> EOF; if($_GET['ID']) { $ID = abs(@intval($_GET['ID'])); } if($_GET['action']) { $_GET['action'] = htmlentities(mysql_real_escape_string($_GET['action'])); } echo '<h2>Mailbox</h2> <table border="1" width="100%" cellspacing="0" class="table"> <tr> <th>[url="'.$_SERVER['PHP_SELF'].'"]Inbox[/url]</th> <th>[url="?action=outbox"]Outbox[/url]</th> <th>[url="?action=compose"]Compose[/url]</th> <th>[url="?action=del"]Delete Message\'s[/url]</th> <th>[url="?action=archive"]Archive Message\'s[/url]</th> </tr> </table>'; switch($_GET['action']) { case 'outbox': outbox(); break; case 'compose': compose(); break; case 'del': del(); break; case 'delb': delb(); break; case 'archive': archive(); break; case 'read': read(); break; default: inbox(); break; } function inbox() { global $ir,$h; echo ' <table border="0" width="100%" cellspacing="0" class="table"> <tr> <th>From</th> <th>Subject</th> <th>Time Sent</th> <th>Actions</th> </tr> <tr>'; $v = mysql_query("SELECT * FROM mail WHERE mail_to='{$ir['userid']}' ORDER BY mail_time DESC LIMIT 10") or die(mysql_error()); while($in = mysql_fetch_assoc($v)) { $whos = mysql_query("SELECT * FROM users WHERE userid='{$in['mail_from']}'") or die(mysql_error()); $who = mysql_fetch_assoc($whos); if($in['mail_read'] == 0) { $read = '<font color="red">New!</font>'; } else { $read = ''; } echo '<td>[url="viewuser.php?u='.$who['userid'].'"]'.$who['username'].'[/url] '.$read.'</td> <td>'.$in['mail_subject'].'</td> <td>'.date("F j, Y, g:i:s a", $in['mail_time']).'</td> <td>[[url="?action=delb&ID='.$in['mail_id'].'"]<font color="red">Delete</font>[/url]] [[url="?action=read&ID='.$in['mail_id'].'"]<font color="green">Read</font>[/url]]</td><tr>'; } echo '</tr></table>'; } function read() { global $ir,$h,$ID,$emos_toggle; if($_POST['subject']) { $msg = $_POST['message']; $msg = str_replace(array("\n"),array(" "),strip_tags($msg)); $subject = $_POST['subject']; $who = abs(@intval($_POST['towho'])); $subject = str_replace(array("\n"),array(" "),strip_tags($subject)); $emos_code = array( ':]', ':D', ':oo:', 'O.o', ':/', ':angry:', ':?:', ':lol:', ':-:', ':O', ':(', 'O.O', ':roll:', ':zzz:', ':)', ':P', ':S', ':nut:', ';)', ':heart:', 'XD', ); $emos_images = array( '[img=images/smileys/happy.gif]', '[img=images/smileys/biggrin.gif]', '[img=images/smileys/cool.gif]', '[img=images/smileys/blink.gif]', '[img=images/smileys/dry.gif]', '[img=images/smileys/angry.gif]', '[img=images/smileys/huh.gif]', '[img=images/smileys/laugh.gif]', '[img=images/smileys/mellow.gif]', '[img=images/smileys/ohmy.gif]', '[img=images/smileys/sad.gif]', '[img=images/smileys/ph34r.gif]', '[img=images/smileys/rolleyes.gif]', '[img=images/smileys/sleep.gif]', '[img=images/smileys/smile.gif]', '[img=images/smileys/tongue.gif]', '[img=images/smileys/unsure.gif]', '[img=images/smileys/wacko.gif]', '[img=images/smileys/wink.gif]', '[img=images/smileys/wub.gif]', '[img=images/smileys/XD.gif]', ); $completed_msg = str_replace($emos_code,$emos_images,$msg); mysql_query("INSERT INTO mail (mail_time,mail_from,mail_to,mail_read,mail_subject,mail_text) VALUES(unix_timestamp(),'{$ir['userid']}','{$who}','0','{$subject}','{$completed_msg}')") or die(mysql_error()); mysql_query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$who}") or die(mysql_error()); echo 'Mail sent successfuly.'; $h->endpage(); exit; } $y = mysql_query("SELECT * FROM mail WHERE mail_id='{$ID}'") or die(mysql_error()); $f = mysql_fetch_assoc($y); if($f['mail_to'] == $ir['userid']) { mysql_query("UPDATE users SET new_mail=new_mail-1 WHERE userid='{$ir['userid']}'") or die(mysql_error()); mysql_query("UPDATE mail SET mail_read=1 WHERE mail_id='{$ID}'") or die(mysql_error()); } $sl_users = mysql_query("SELECT * FROM users WHERE userid='{$f['mail_from']}'") or die(mysql_error()); $sl = mysql_fetch_assoc($sl_users); $to_users = mysql_query("SELECT * FROM users WHERE userid='{$f['mail_to']}'") or die(mysql_error()); $tl = mysql_fetch_assoc($to_users); if($f['mail_from'] == $ir['userid']) { $pass = 1; } else { $pass = 0; } if($f['mail_to'] != $ir['userid']) { if($pass != 1) { echo 'This mail is not yours!'; $h->endpage(); exit; } } if($f['mail_from'] == $ir['userid']) { $ton = $f['mail_to']; } else { $ton = $f['mail_from']; } echo ' <h2>From: '.$sl['username'].' To: '.$tl['username'].'</h2> <table border="0" cellspacing="0" class="table" width="100%"> <tr> <th>Subject</th> <th>Mail</th> </tr> <tr> <td width="20%">'.$f['mail_subject'].'</td> <td width="80%">'.$f['mail_text'].'</td> </tr> </table> <h2>Quick Response</h2> <form action="?action=read" method="post"> To: <input type="text" value="'.$ton.'" name="towho" readonly> Subject: <input type="text" name="subject" value="No Subject"> Mail: <textarea name="message" cols="50" rows="10" id="message"></textarea> <input type="submit" value="Send"> </form> '.$emos_toggle; } function compose() { global $ir,$h,$emos_toggle; if($_POST['towho']) { $msg = $_POST['message']; $msg = str_replace(array("\n"),array(" "),strip_tags($msg)); $subject = $_POST['subject']; $who = abs(@intval($_POST['towho'])); $subject = str_replace(array("\n"),array(" "),strip_tags($subject)); $emos_code = array( ':]', ':D', ':oo:', 'O.o', ':/', ':angry:', ':?:', ':lol:', ':-:', ':O', ':(', 'O.O', ':roll:', ':zzz:', ':)', ':P', ':S', ':nut:', ';)', ':heart:', 'XD', ); $emos_images = array( '[img=images/smileys/happy.gif]', '[img=images/smileys/biggrin.gif]', '[img=images/smileys/cool.gif]', '[img=images/smileys/blink.gif]', '[img=images/smileys/dry.gif]', '[img=images/smileys/angry.gif]', '[img=images/smileys/huh.gif]', '[img=images/smileys/laugh.gif]', '[img=images/smileys/mellow.gif]', '[img=images/smileys/ohmy.gif]', '[img=images/smileys/sad.gif]', '[img=images/smileys/ph34r.gif]', '[img=images/smileys/rolleyes.gif]', '[img=images/smileys/sleep.gif]', '[img=images/smileys/smile.gif]', '[img=images/smileys/tongue.gif]', '[img=images/smileys/unsure.gif]', '[img=images/smileys/wacko.gif]', '[img=images/smileys/wink.gif]', '[img=images/smileys/wub.gif]', '[img=images/smileys/XD.gif]', ); $completed_msg = str_replace($emos_code,$emos_images,$msg); mysql_query("INSERT INTO mail (mail_time,mail_from,mail_to,mail_read,mail_subject,mail_text) VALUES(unix_timestamp(),'{$ir['userid']}','{$who}','0','{$subject}','{$completed_msg}')") or die(mysql_error()); mysql_query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$who}") or die(mysql_error()); echo 'Mail sent successfuly.'; $h->endpage(); exit; } if($_GET['ID']) { $value = $_GET['ID']; } else { $value = ""; } echo '<form action="?action=compose" method="post"> Who To: <input type="text" name="towho" value="'.$value.'"> Subject: <input type="text" name="subject" value="No Subject"> Message: <textarea name="message" cols="50" rows="10" id="message"></textarea> <input type="submit" value="Send"> </form> '.$emos_toggle; } function outbox() { global $ir,$h; echo ' <table border="1" width="100%" cellspacing="0" class="table"> <tr> <th>To</th> <th>Subject</th> <th>Time Sent</th> <th>Actions</th> </tr> <tr>'; $v = mysql_query("SELECT * FROM mail WHERE mail_from='{$ir['userid']}' ORDER BY mail_time DESC LIMIT 10") or die(mysql_error()); while($in = mysql_fetch_assoc($v)) { $whos = mysql_query("SELECT * FROM users WHERE userid='{$in['mail_to']}'") or die(mysql_error()); $who = mysql_fetch_assoc($whos); echo '<td>[url="viewuser.php?u='.$who['userid'].'"]'.$who['username'].'[/url]</td> <td>'.$in['mail_subject'].'</td> <td>'.date("F j, Y, g:i:s a", $in['mail_time']).'</td> <td>[[url="?action=read&ID='.$in['mail_id'].'"]<font color="green">Read</font>[/url]]</td><tr>'; } echo '</tr></table>'; } function delb() { global $ir,$h,$ID; $t = mysql_query("SELECT * FROM mail WHERE mail_id='{$ID}'") or die(mysql_error()); $r = mysql_fetch_assoc($t); if($r['mail_to'] != $ir['userid']) { echo 'This mail is not yours!'; $h->endpage(); exit; } mysql_query("DELETE FROM mail WHERE mail_id='{$ID}'") or die(mysql_error()); echo 'Mail deleted successfuly.'; inbox(); } function del() { global $ir,$h; if($_POST['gohome']) { header("location: index.php"); exit; } if($_POST['yes']) { $q = mysql_query("SELECT * FROM mail WHERE mail_to='{$ir['userid']}'") or die(mysql_error()); $f = mysql_num_rows($q); mysql_query("DELETE FROM mail WHERE mail_to='{$ir['userid']}'") or die(mysql_error()); echo $f.' mails deleted.'; $h->endpage(); exit; } echo 'Are you sure you want to delete all your mails? <form action="?action=del" method="post"> <input type="submit" value="Yes" name="yes"> | <input type="submit" value="No" name="gohome"> </form>'; } function archive() { echo 'This tool allows you to download your mails to your computer. [url="dlarchive.php?a=inbox"]Download Inbox Messages[/url] [url="dlarchive.php?a=outbox"]Download Outbox Messages[/url] Select a link above.'; } $h->endpage(); ?>
  3. Re: [mccode] Money,crystals cap Ok, i got the SQL part down   ALTER TABLE `users` CHANGE `money` `money` BIGINT( 11 ) NOT NULL DEFAULT '0', CHANGE `crystals` `crystals` INT( 10 ) NOT NULL DEFAULT '0', CHANGE `bankmoney` `bankmoney` BIGINT( 11 ) NOT NULL DEFAULT '0', CHANGE `cybermoney` `cybermoney` BIGINT( 11 ) NOT NULL DEFAULT '0'   got some help from Emphesis, change all the (int) values to (Float)
  4. Re: [mccodes V2] Free Game Template anyone have way of getting this to work with v1 i have most of the files corrected except the login file im pretty sure, since i was already logged in and was able to see everything perfectly login.php file <?php session_start(); include "config.php"; global $_CONFIG; 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; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $page = (isset($_GET['p'])) ? preg_replace("/[^a-zA-Z0-9]/","",strip_tags(trim($_GET['p']))) : 'news' ; $pageArray = array('register','fpass','screenshots','news'); $pageTitle = array('news'=>'Game News','register'=>'Registration','fpass'=>'Forgot Password','screenshots'=>'Game Screenshots'); $pageTitle = $pageTitle[$page]; print <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']} - {$pageTitle}</title> <link rel="stylesheet" type="text/css" href="style.css" /> <script language="JavaScript" type="text/javascript" src="login.js" /></script> </head> <body onload="getme();" id="login"> <div id="wrapper"> <div id="header"> <ul> [*][url="#"]Settings[/url] [*][url="#"]High Scores[/url] [*][url="#"]Manual[/url] [*][url="#"]Forum[/url] [*][url="#"]Chat[/url] [/list] </div> <div id="banner">[img=images/pog1.png]</div> <div id="leftNav"> <ul> <li class="header">Login <li class="login"> <form action="authenticate.php" method="post" name="login" onsubmit="return saveme();">Username <input type="text" name="username"> Password <input type="password" name="password"> Remember me? <input type="radio" value="ON" name="save"> Yes <input type="radio" name="save" value="OFF" checked> No <input type=submit value=Submit> </form> [*][url="login.php?p=news"]News[/url] [*][url="login.php?p=register"]Register[/url] [*][url="login.php?p=fpass"]Forgot Password[/url] [*][url="login.php?p=screenshots"]Screenshots[/url] [/list] </div> <div id="mainContent"> EOF; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$IP)){ die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); }; if(in_array($page,$pageArray)) { switch($page) { case 'register':register();break; case 'fpass':fpass();break; case 'screenshots':screenshots();break; default:news();break; } } function register() { function valid_email($email) { if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { return false; } $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } if(isset($_POST['register'])) { $username = preg_replace("/[^a-zA-Z0-9]/","",strip_tags(trim($_POST['username']))); if(!valid_email($_POST['email'])) { $errorMSG .= '[*]Sorry, the email is invalid.'; } if(strlen($username) < 4) {$errorMSG .= '[*]Sorry, the username is too short.'; } $string = sprintf("SELECT username,login_name FROM `users` WHERE `username` = '%u' OR `login_name` = '%u'",$username,$username); $result = mysql_query($string); echo (!$result) ? 'SELECTION ERROR' : ''; if(mysql_num_rows($result)) { $errorMSG .= '[*]Username already in use. Choose another.'; } $string = sprintf("SELECT email FROM `users` WHERE `email` = '%s'",$_POST['email']); $result = mysql_query($string); echo (!$result) ? 'SELECTION ERROR' : ''; if(mysql_num_rows($result)) { $errorMSG .= '[*]E-Mail already in use. Choose another.'; } if($_POST['pw1'] != $_POST['pw2']) { $errorMSG .= '[*]The passwords did not match, go back and try again.'; } $_POST['ref'] = abs((int) $_POST['ref']); $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query(sprintf("SELECT lastip,userid FROM `users` WHERE `lastip` = '$u' AND `userid` = '%u'",$IP,$_POST['ref'])); if(mysql_num_rows($q)) { $errorMSG .= '[*]No creating referral multies. Bad dog.'; } if(!isset($errorMSG)) { if($_POST['ref']) { $q=(sprintf("SELECT userid FROM users WHERE `userid` = '%u'",$_POST['ref'])); $r=$db->fetch_row($q); } // ******************************** // // Insert your querys for when the playe registers here // ******************************** // if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); $db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); } print ' You have signed up, enjoy the game.</p>'; } else { echo '<div id="errorBox"><h3>You had some errors</h3>[list=1]'.$errorMSG.'[/list] [url="login.php?p=register"]Back[/url]</p></div>'; } } else { if($set['regcap_on']){ $chars="123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!?\\/%^"; $len=strlen($chars); $_SESSION['captcha']=""; for($i=0;$i<6;$i++) $_SESSION['captcha'].=$chars[rand(0, $len - 1)]; } ?> <form id="registerForm" method="post"> <fieldset id="pt1"> <legend><span>Step </span>1. <span>: Login details</span></legend> <h3>Pick a login name.</h3> <div class="help"> This will be the name used to login, even if you change your username later this will not change. </div> <label for="username">Login / Username</label> <input id="username" name="username" type="text" onkeyup="CheckUsername(this.value);" /> <div id="usernameresult"></div> </fieldset> <fieldset id="pt2"> <legend><span>Step </span>2. <span>: Password</span></legend> <h3>Choose a password for your new account.</h3> <div class="help">Passwords must be 6-30 characters in length.</div> <label for="pw1">Password</label> <input id="pw2" name="pw1" onkeyup="CheckPasswords(this.value);PasswordMatch();" type="password" /> <label for="pw2">Repeat Password</label> <input id="pw2" name="pw2" onkeyup="PasswordMatch();" type="password" /> </fieldset> <fieldset id="pt3" class="error"> <legend><span>Step </span>3. <span>: Email details</span></legend> <h3>Enter your email address.</h3> <div class="help">You must enter a valid email address to activate your account.</div> <label for="email1">Email</label> <input id="email1" type="text" name="email" onkeyup="CheckEmail(this.value);" /> <div id="emailresult"></div> </fieldset> <fieldset id="pt4"> <legend>Step 4 : Submit form</legend> <h3>Terms of Service</h3> <div id="disclaimer">By clicking the 'Complete Signup' button, I am attaching my electronic signature to and agreeing to the Squarespace Terms of Service Agreement; I understand that if I do not agree to these terms of use and privacy statements, I should refrain from using Squarespace.</div> <input id="submitform" name="register" value="Complete Registration" type="submit" /> </fieldset> <br style="clear:both" /> </form> <? } } function fpass() { echo ' put your content here</p>'; } function screenshots() { echo ' put your content here</p>'; } function news() { echo ' Put your content here. This will be the home page</p>'. ' For a demo of the imgame template login with the demo login;</p>'. ' [b]User: [/b] demo [b]Password[/b] demo</p>'; } ?> </div> <div id="footer"> <div id="copyright">Copyright GameName. All rights reserved. Design by [url="http://pog1.co.cc"]Pogone Design[/url]</div> <div id="privacy">[url="#"]Terms of Service[/url] | [url="#"]Privacy Policy[/url] | [url="#"]Game Rules[/url] | [url="#"]Contact[/url]</div> </div> </div> </body> </html>   register.php <?php session_start(); print "<html> <head> <title>Thug Mayhem</title> <style> body { font-family:Verdana;font-size:9pt;color: red; background-color: black; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: white;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <body><center>[img=logo.png]</center> "; $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } require "mysql.php"; global $c; if($_POST['username']) { $sm=100; if($_POST['promo'] == "Your Promo Code Here") { $sm+=100; } $username=$_POST['username']; $username=str_replace(array("<", ">"), array("<", ">"), $username); $q=mysql_query("SELECT * FROM users WHERE username='{$username}'",$c); if(mysql_num_rows($q)) { print "Username already in use. Choose another."; } else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again."; } else { $_POST['ref'] = abs((int) $_POST['ref']); $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT * FROM users WHERE lastip='$ip' AND userid={$_POST['ref']}",$c); if(mysql_num_rows($q)) { die("No creating referral multies. Bad dog."); } if($_POST['ref']) { $q=mysql_query("SELECT * FROM users WHERE userid={$_POST['ref']}",$c); $r=mysql_fetch_array($q); } mysql_query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'Male', unix_timestamp(), '{$_POST['email']}', -1, '$ip')", $c); $i=mysql_insert_id($c); mysql_query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)", $c); if($_POST['ref']) { require "global_func.php"; mysql_query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); mysql_query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$ip')", $c); } print "You have signed up, enjoy the game. > [url='login.php']Login[/url]"; } } else { print "<center><h3><Thug Mayhem Registration</h3>"; print "<center><h3>Fill out the form below to Join Free!</h3>"; print "<form action=register.php method=post>[b]Username:[/b] <input type=text name=username> [b]Password: <input type=password name=password> Confirm Password: <input type=password name=cpassword> Email: <input type=text name=email> Promo Code[/b] (Leave blank if unknown): <input type=text name=promo> <input type=hidden name=ref value='"; if($_GET['REF']) { print $_GET['REF']; } print "'> <input type=submit value=Submit></center></form> <center>[url='login.php'][Go Back][/url]</center>"; } print "</body></html>"; ?> </center>
  5. Re: [mccode v2] Index.php Update For version 1 if anyone wants it <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $housequery=1; echo "<h2>General Info:</h2>"; $exp=(int)($ir['exp']/$ir['exp_needed']*100); echo " <table class='table'> <tr> <th>Name</th> <th>Crystals</th> <th>Level</th> <th>Exp.</th> <th>Money</th> <th>Health</th> <th>House</th> </tr> <tr> <td><center>".$ir['username']."</center></td> <td><center>".$cm."</center></td> <td><center>".$ir['level']."</center></td> <td><center>".$exp."</center></td> <td><center>$fm</center></td> <td><center>".$ir['hp']."</center></td> <td><center>".$ir['hNAME']."</center></td> </tr> </table> <h2>Stats:</h2>"; $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $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'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); echo " <table class='table'> <tr> <th>Strength</th> <th>Agility</th> <th>Guard</th> <th>Labour</th> <th>IQ</th> <th>Total Stats</th> </tr> <tr> <td><center>".$ir['strength']."</center></td> <td><center>".$ir['agility']."</center></td> <td><center>".$ir['guard']."</center></td> <td><center>".$ir['labour']."</center></td> <td><center>".$ir['IQ']."</center></td> <td><center>".$ts."</center></td> </tr> </table> <h2>Stats Rankings:</h2> <table class='table'> <tr> <th>Strength</th> <th>Agility</th> <th>Guard</th> <th>Labour</th> <th>IQ</th> <th>Total Stats</th> </tr> <tr> <td><center>Number: ".$ir['strank']."</center></td> <td><center>Number: ".$ir['agirank']."</center></td> <td><center>Number: ".$ir['guarank']."</center></td> <td><center>Number: ".$ir['labrank']."</center></td> <td><center>Number: ".$ir['IQrank']."</center></td> <td><center>Number: $tsrank</center></td> </tr> </table> "; if(isset($_POST['pn_update'])) { $update = sprintf("UPDATE users SET user_notepad = '%s' WHERE userid = '%u' ", ($_POST['pn_update']), ($ir['userid'])); mysql_query($update); $ir['user_notepad']=stripslashes($_POST['pn_update']); header('Location: index.php'); } echo " <hr> Your Personal Notepad: <form action='index.php' method='post'> <textarea rows='10' cols='50' name='pn_update'>".htmlspecialchars($ir['user_notepad'])."</textarea> <input type='submit' value='Update Notes' /> </form>"; $h->endpage(); ?>
  6. Re: [mccode v1] Mccodes V1 Jail because they didnt add it... thats why people mad there own... v1 works with v1.1 fine
  7. Re: [mccode v1 + v2] Lucky Boxes Thanks for that one
  8. Re: [mccode v1 + v2] Lucky Boxes this is going to need a cron was just thinking about this... does anyone have the cron job for this? it would be a daily run cron
  9. Re: Daily Donators Reward [Mccode v2] For v1   <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); //Don't really know why I bothered securing this.. //I'm bored, need something to do -.- //Look at what I'm reduced to! xD //And for the love of God Almighty Himself, LEARN TO SPELL! //"Secured" by Magictallguy - very little to secure, mostly bug fixes.. if(!$ir['donatordays']) { echo "Sorry, This Feature is for Donators only!"; $h->endpage(); exit; } echo "<span style='text-align:center;'>Daily Donators Reward</span> <span style='font-style:italic;'>You can request a reward once a day</span> "; if(isset($_GET['reward'])) { if($ir['rewarddone'] > 1) { echo "You have already got your reward today! Come back tomorrow"; } $num = rand(1,3); $sql = sprintf("UPDATE users SET rewarddone = rewarddone + 1 WHERE (userid = %u)", $userid); mysql_query($sql); //$ir['money'] = 100; //Is there really any need for this line? switch($num) { case 1: $money = rand(5000,100000); echo sprintf("<span style='color:blue;'>You gained \$%s</span>", number_format($money)); $inc_money = sprintf("UPDATE users SET money = money + %u WHERE (userid = %u)", $money, $userid); mysql_query($inc_money); break; case 2: $crystal = rand(10,100); echo sprintf("<span style='color:blue;'>You gained %u crystals</span>", $crystal); $inc_crystals = sprintf("UPDATE users SET crystals = crystals + %u WHERE (userid = %u)", $crystal, $userid); mysql_query($inc_crystals); break; case 3: $brave = rand(1,30); echo "<span style='color:blue;'>You gained %u brave</span>"; $inc_brave = sprintf("UPDATE user SET brave = brave + %u WHERE (userid = %u)", $brave, $userid); mysql_query($inc_brave); break; } } echo "<span style='text-align:center;'>[url='reward.php?reward=?']Reward[/url]</span>"; $h->endpage(); ?>   but i am having the problem of it crediting even after the you click reward 3 times, you can just keep clicking it.... btw magic had a slight error in his code v2 <?php include(DIRNAME(__FILE__) . '/globals.php'); //Don't really know why I bothered securing this.. //I'm bored, need something to do -.- //Look at what I'm reduced to! xD //And for the love of God Almighty Himself, LEARN TO SPELL! //"Secured" by Magictallguy - very little to secure, mostly bug fixes.. if(!$ir['donatordays']) { echo "Sorry, This Feature is for Donators only!"; $h->endpage(); exit; } echo "<span style='text-align:center;'>Daily Donators Reward</span> <span style='font-style:italic;'>You can request a reward once a day</span> "; if(isset($_GET['reward'])) { if($ir['rewarddone'] > 1) { echo "You have already got your reward today! Come back tomorrow"; } $num = rand(1,3); $sql = sprintf("UPDATE users SET rewarddone = rewarddone + 1 WHERE (userid = %u)", $userid); $db->query($sql); //$ir['money'] = 100; //Is there really any need for this line? switch($num) { case 1: $money = rand(500,1000); echo sprintf("<span style='color:blue;'>You gained \$%s</span>", number_format($money)); $inc_money = sprintf("UPDATE users SET money = money + %u WHERE (userid = %u)", $money, $userid); $db->query($inc_money); break; case 2: $crystal = rand(5,10); echo sprintf("<span style='color:blue;'>You gained %u crystals</span>", $crystal); $inc_crystals = sprintf("UPDATE users SET crystals = crystals + %u WHERE (userid = %u)", $crystal, $userid); $db->query($inc_crystals); break; case 3: $brave = rand(1,3); echo "<span style='color:blue;'>You gained %u brave</span>"; $inc_brave = sprintf("UPDATE user SET brave = brave + %u WHERE (userid = %u)", $brave, $userid); $db->query($inc_brave); break; } } echo "<span style='text-align:center;'>[url='reward.php?reward=?']Reward[/url]</span>"; $h->endpage(); ?>   This part { echo "You have already got your reward today! Come back tomorrow"); }   was changed to this { echo "You have already got your reward today! Come back tomorrow"; }   i removed the ) at the end of the middle line it gave you an error
  10. Re: [mccode v2] Lucky Boxes   Thanks!
  11. Re: [mccode v2] Lucky Boxes   <?php /*------------------------------------------- - Made by BlueDevil23 - Please do not resell - Blah blah blah - Like people will actually keep this here - =) -------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); echo "<style type='text/css'>"; echo ".success { color: green; }"; echo ".fail { color: red; }"; echo "</style>"; /*---------------------------------------- Configs | ----------------------------------------*/ $boxprice = 100; // Price of each box $boxlimit = 5; // Maximum amount of boxes an user can open a day $mincrystals = 1; // Minimum amount of crystals a user can win, see Case 1 $maxcrystals = 5; // Maximum amount of crystals a user can win, see Case 1 $minmoney = 100; // Minimum amount of money a user can win, see Case 2 $maxmoney = 300; // Maximum amount of money a user can win, see Case 2 $itmarray = array(1, 2, 3, 4); // Item IDs of possible items a user can win, see Case 4 /*---------------------------------------- End Configs | ----------------------------------------*/ $boxplural = (($boxlimit > 1) ? $boxplural = 'es' : $boxplural = ''); echo "<h2> Lucky Boxes </h2>"; printf("<h4 style='padding-bottom:5px;'> You may open up to %d box%s a day </h4>", abs(@intval($boxlimit)), mysql_real_escape_string(trim($boxplural))); printf("<h4 style='padding-bottom:20px;'> Today, you have opened %d, so far. </h4>", abs(@intval($ir['boxes_opened']))); if(isset($_GET['open'])) { if($ir['boxes_opened'] >= $boxlimit) { die("Sorry, you have already opened $boxlimit box$boxplural today. Come back tomorrow."); } if($ir['money'] < $boxprice) { die("Sorry, it costs \$$boxprice to open a box. Come back when you have enough."); } $num = mt_rand(1, 4); mysql_query(sprintf("UPDATE `users` SET `boxes_opened` = `boxes_opened` + '1', `money` = `money` - ('%d') WHERE userid = ('%u')", abs(@intval($boxprice)), abs(@intval($userid)))) or die(mysql_error()); switch($num) { case 1: $tokens = mt_rand($mincrystals, $maxcrystals); $singular = (($tokens > 1) ? $singular = 's' : $singular = ''); printf("<h3 class='success'> You gained %d crystal%s </h3>", abs(@intval($tokens)), mysql_real_escape_string(trim($singular))); mysql_query(sprintf("UPDATE `users` SET `crystals` = `crystals` + ('%d') WHERE `userid` = ('%u')", abs(@intval($tokens)), abs(@intval($userid)))) or die(mysql_error()); break; case 2: $money = mt_rand($minmoney, $maxmoney); printf("<h3 class='success'> You gained \$%d </h3>", abs(@intval($money))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` + ('%d') WHERE `userid` = ('%u')", abs(@intval($money)), abs(@intval($userid)))) or die(mysql_error()); break; case 3: $stole = min(rand($ir['money']/10, $ir['money']/5), 5000); (($ir['money'] < $stole) ? $stole = $ir['money'] : $stole = $stole); printf("<h3 class='fail'> You lost \$%d </h3>", abs(@intval($stole))); mysql_query(sprintf("UPDATE `users` SET `money` = `money` - ('%d') WHERE `userid` = ('%u')", abs(@intval($stole)), abs(@intval($userid)))) or die(mysql_error()); break; case 4: $item = array_rand($itmarray); echo "<h3 class='success'> You won a random item, check your inventory for it! </h3>"; item_add(abs(@intval($userid)), $item, 1); break; } echo "<ul style='list-style-type:none;line-height:2em;'> [*][url='lucky.php?open=1'] Open Another Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } else { printf("A man comes up to you and whispers, \"I have magical boxes, I'll let you open one for \$%d. Deal or no deal?", abs(@intval($boxprice))); echo "<ul style='list-style-type:none;line-height:2em;padding-top:15px;'> [*][url='lucky.php?open=1'] Open One Box [/url] [*][url='explore.php'] Back to Town [/url] [/list]"; } $h->endpage(); ?> For v1 but i need the sql inserts do you think you could post those specifically i need the 'boxes_opened' in 'field list'
  12. Re: Funney Error The brave part you dont only have to change it on the .php file but also in the database click you db then click browse the crimes table find the crime that takes the wrong amount of brave and correct it click the little pencil tool to edit it then save to apply your changes didnt understand the first part though
  13. Re: Error: This script requires an action. did you make any changes to those files? Do you still have the original files? Take the ordinals and overwrite the ones your are having problems with.
  14. Re: [mccode v1] Mccodes V1 Jail Ahhh! thank you soo much works beautifully!!!
  15. Re: [mccode v1] Mccodes V1 Jail poo... it doesnt let me bust my self out A+ :D but other people cant bust me out... is the error i get
  16. Re: [mccode v1] Mccodes V1 Jail   Did you get any errors? just says   I reccomend you make a new topic
  17. Re: [mccode v1] Mccodes V1 Jail yeah sorry didnt work
  18. Re: [mccode v1] Mccodes V1 Jail sorry, didnt work
  19. Re: [mccode v1] Mccodes V1 Jail anyone have an update on not being able to bust your self out?
  20. Re: [mccode v1] Mccodes V1 Jail i kept getting Parse error: syntax error, unexpected T_ELSE in /home/thugmayh/public_html/bust.php on line 132 so i just reversed anything that i had done, here is my bust.php file   <?php // Bust with EXP.....additional jail feature for your game // Coded by TwiztedFake ([email protected]) // This is a free mod, released on CE by TwiztedFake on 3/8/08 // Version 1.0 session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); //General settings used throughout the script, edit to suit your needs $base = 1.1; // General setting for use in the outcome equation, the higher this number is the harder it makes a successful outcome for a jail bust. $baseChance = 10; // This is the base percentage chance, if the equation yields a lower percentage this is used by default. $minEXP = 10; // To prevent any errors and give players a bit of exp if they don't have it lets set a minium EXP $bustCost = 10; // This is the brave needed to bust out, or bust someone else out $baseExpGain = 500; // This is used for the EXP gain/loss from outcome, the higher the number...the more exp gained per bust...gain = level * baseExpGain $baseExpLost = 0; // This sets how much is loss on failure, it is lost = gain * baseExpLost $id = abs((int) $_GET['u']); //Get players Id //Lets check some necessary information before we continue on with the script $z=mysql_query("SELECT * FROM users WHERE userid = $id",$c) or die(mysql_error()); if(!mysql_num_rows($z)) // Make sure an id was selected { print "System Error: Either you didn't select an id or the system failed to pass the information along."; $h->endpage(); die(""); } $user = mysql_fetch_array($z); // Most have been an id defined if we got this far, so lets get there info if($ir['userid'] == $id AND !$ir['jail']) //Lets make sure the player is not trying to bribe/bust someone else while they themselves are in jail { print "Error: You can't bust yourself out, your not in jail."; $h->endpage(); die(""); } if(!$user['jail']) // Lets make sure the id in question is in jail { print "Error: The player you selected is not in jail."; $h->endpage(); die(""); } if($ir['userid'] != $id AND $ir['jail']) //Lets make sure the player is not trying to bust someone else while they themselves are in jail { print "Error: You can't bust someone else out while you are in jail"; $h->endpage(); die(""); } if($ir['brave'] < $bustCost) // Lets make sure the player has enough brave to bust { print "Error: You do not have enough brave to attempt a bust."; $h->endpage(); die(""); } // Do all the math stuff before we continue on $suc = (($ir['jailEXP'] + $minEXP) * $base) / ($user['level'] + 0.5); // Figure out the players percenatage of success $gain = $ir['level'] * $baseExpGain; // Figure out the jailEXP gained $lost = $gain * $baseExpLost; // Figure out the jailEXP lost // Lets check the success percentage against the base success if($suc < $baseChance) // if $suc is less than $baseChance, lets use $baseChance instead to improve the outcome { $suc = $baseChance; } // Now lets get on with it and see if the player is successful $chance = rand(1,3); // succeess random if($suc > $chance) // bust was succesful { mysql_query("UPDATE users SET jailEXP = jailEXP + $gain WHERE userid = $userid",$c) or die(mysql_error()); if($ir['userid'] != $id) // success outcome for busting another player out { mysql_query("UPDATE users SET jail = 0 WHERE userid = $id",$c) or die(mysql_error()); event_add($id,"[url='viewuser.php?u=$userid']{$ir['username']}[/url] busted you from jail.",$c); mysql_query("UPDATE users SET brave = brave - $bustCost WHERE userid = $userid",$c) or die(mysql_error()); print "You busted {$user['username']} out of jail."; $h->endpage(); die(""); } else // success outcome for busting yourself out { mysql_query("UPDATE users SET brave = brave - $bustCost, jail = 0 WHERE userid = $userid",$c) or die(mysql_error()); print "You busted out of jail."; $h->endpage(); die(""); } } else // bust failed { $length = rand(15,35); // Jail time length if caught $newEXP = $ir['jailEXP'] - $lost; if($newEXP < 0) { $newEXP = 0.0000; // Lets not let it ever go negative } mysql_query("UPDATE users SET brave = brave - $bustCost, jail = jail + $length, jailEXP = $newEXP WHERE userid = $userid",$c) or die(mysql_error()); if(!$ir['jail'] AND $ir['userid'] != $id) // failed outcome for busting another player out { $reason = "Caught trying to bust {$user['username']}"; mysql_query("UPDATE users SET jailreason='Caught trying to bust {$user['username']} out of jail' WHERE userid = $userid",$c) or die(mysql_error()); print "The guards caught you trying to bust {$user['username']} out of jail. Now you have been thrown in jail for $length minutes."; $h->endpage(); die(""); } else // failed outcome for busting yourself out { mysql_query("UPDATE users SET jailreason='Caught trying to bust out of jail' WHERE userid = $userid",$c) or die(mysql_error()); print "The guards caught you trying to bust out of jail, $length minutes was added to your stay."; $h->endpage(); die(""); } } $h->endpage(); ?>
  21. Here is my crime.php file... i am not getting exp from succesfully commiting a crime   <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $q=mysql_query("SELECT * FROM crimegroups ORDER by cgORDER ASC",$c); print "[b]Criminal Centre[/b] <table width='75%'><tr><th>Crime</th><th>Cost</th><th>Do</th></tr>"; while($r=mysql_fetch_array($q)) { print "<tr style='background-color:gray'><td colspan='3'>{$r['cgNAME']}</td></tr>"; $q2=mysql_query("SELECT * FROM crimes WHERE crimeGROUP={$r['cgID']}",$c); while ($r2=mysql_fetch_array($q2)) { print "<tr><td>{$r2['crimeNAME']}</td><td>{$r2['crimeBRAVE']} Brave</td><td>[url='docrime.php?c={$r2[']Do[/url]</td></tr>"; } } $h->endpage(); ?>   here is my docrime.php file   <?php /*----------------------------------------------------- -- Free Mod For CE -- docrime.php edited by $Bull$$ EYE$ -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); 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","EXP","WILL","IQ"), array($ir['level'], $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,10) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET crimes=crimes+1 WHERE userid={$ir['userid']}",$c); mysql_query("UPDATE users SET money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c); } else { print $r['crimeFTEXT']; $jailtime=(int) rand(1,15); mysql_query("UPDATE users SET jail=$jailtime WHERE userid=$userid", $c); mysql_query("UPDATE users SET jailreason='Failed a crime' WHERE userid=$userid", $c); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } $h->endpage(); ?>
  22. Re: [mccode v1] Mccodes V1 Jail wondering if anyone has a fix?
  23. Re: [mccode v1] Mccodes V1 Jail fixed the timer updating part now only problem is that i can bust my self out
  24. Re: [mccode v1] Mccodes V1 Jail cant edit my original post but i can also bust my self out of jail
  25. Re: [mccode v1] Mccodes V1 Jail i understand this is topic is a bit old but, its the only one i can find for mccodes v1 jail mod, i have users reporting that they are in jail for a lot longer than what the timer says ex: jail timer says 10 minuets but they reamin in the jailf or hours untill someone bust them out... here are my files jail.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- Made By $Bull$$ EYE$(Uk Assassins) -- Jail.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); print "<h3>Jail</h3> <table width='75%' border='2'><tr bgcolor=gray><th>ID</th><th>Name</th <th>Level</th> <th>Time</th><th>Reason</th><th>Bust Out</th></tr>"; $q=mysql_query("SELECT u.*,c.* FROM users u LEFT JOIN gangs c ON u.gang=c.gangID WHERE u.jail > 0 ORDER BY u.jail DESC",$c); while($r=mysql_fetch_array($q)) { print "\n<tr><td>{$r['userid']}</td><td>{$r['gangPREFIX']} [url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td><td> {$r['level']}</td><td>{$r['jail']} minutes</td><td>{$r['jailreason']}</td><td>[url='bust.php?u={$r[']Bust[/url]</tr>"; } print "</table>"; $h->endpage(); ?>   crons/are/not/4u/jail.php <?php require "mysql.php"; require "../../../../global_func.php"; global $c; mysql_query("UPDATE users set jail=jail-1 WHERE jail>0",$c); ?>   docrime.php <?php /*----------------------------------------------------- -- Free Mod For CE -- docrime.php edited by $Bull$$ EYE$ -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); 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","EXP","WILL","IQ"), array($ir['level'], $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['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET crimes=crimes+1 WHERE userid={$ir['userid']}",$c); mysql_query("UPDATE users SET money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c); } else { print $r['crimeFTEXT']; $jailtime=(int) rand(1,15); mysql_query("UPDATE users SET jail=$jailtime WHERE userid=$userid", $c); mysql_query("UPDATE users SET jailreason='Failed a crime' WHERE userid=$userid", $c); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } $h->endpage(); ?>
×
×
  • Create New...