gangstas-conflict Posted March 15, 2008 Posted March 15, 2008 when i do a crime you both suceed and fail at the same time. 1. You see a bum under the bridge. 2. You grab him by the hair and drag him back to your apartment. Result: The police give you the cash so they don't have to clean up the mess of another dead body. Result: The bum beats the hell out of you and takes your ass to jail. Try Again Crimes How do i get it to where that doesnt happen? Quote
General Doom Posted March 15, 2008 Posted March 15, 2008 Re: crimes You must have a missing if statement somwhere, post the script? Quote
gangstas-conflict Posted March 15, 2008 Author Posted March 15, 2008 Re: crimes <?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(); if($ir['jail']) { print"You cannot do crimes while youre in jail."; $h->endpage(); exit; } if($ir['hospital']) { print"You cannot do crimes while youre in the hospital."; $h->endpage(); exit; }$q=mysql_query("SELECT * FROM crimegroups ORDER by cgORDER ASC",$c); print "[b]Do Crimes[/b] <table width='75%'><tr><th>Crime</th><th>Cost</th><th>Payout</th><th>Do</th></tr>"; while($r=mysql_fetch_array($q)) { print "<tr style='background-color:gray'><td colspan='4'>{$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><center>{$r2['crimeBRAVE']} Brave</td><td><center>\${$r2['crimeSUCCESSMUNY']}</center></td><td><center>[url='docrime.php?c={$r2[']Do[/url]</center></td></tr>"; } } ?> Quote
dementor Posted March 15, 2008 Posted March 15, 2008 Re: crimes We need to see the docrime.php file ? Quote
gangstas-conflict Posted March 15, 2008 Author Posted March 15, 2008 Re: crimes <?php /* MCCodes Lite docrime.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 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']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); $_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) mysql_query("UPDATE users SET prison=0 WHERE userid=$bail", $c); { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['exp']+=$r['crimeEXP']; mysql_query("UPDATE users SET money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c); } { print $r['crimeFTEXT']; } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } } $h->endpage(); ?> Quote
dementor Posted March 15, 2008 Posted March 15, 2008 Re: crimes there a else missing from what I can see But ill wait for someone more qualified to speak up :) Quote
AlabamaHit Posted March 16, 2008 Posted March 16, 2008 Re: crimes i think you just need to add else just before { print $r['crimeFTEXT']; Quote
gangstas-conflict Posted March 16, 2008 Author Posted March 16, 2008 Re: crimes tried that and got this Parse error: syntax error, unexpected T_ELSE in /home/gangstas/public_html/docrime.php on line 66 Quote
dementor Posted March 17, 2008 Posted March 17, 2008 Re: crimes means } or { is missing somewhere I presume xD 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.