Jump to content
MakeWebGames

[v1]Request For Failing Crime Results to jail


HITMAN 17
 Share

Recommended Posts

Re: [v1]Request For Failing Crime Results to jail

If you use this one that I edited for you yesterday then it will send you to jail when you fail.......... sometimes........ its random, sometimes you just fail, sometimes you get thrown in jail. But if I remember correctly on my V1 it didn't come with jail.php so I had to make my own, and it also doesn't come with jail_reason in the user database which you will have to add that in there yourself. Other than that I tested it on my test site and it worked like a charm everytime.

the sql is

 

ALTER TABLE `crimes` 
ADD `crimeJTEXT` TEXT NOT NULL AFTER `crimeFTEXT` ,
ADD `crimeJAILTIME` INT NOT NULL DEFAULT '0' AFTER `crimeJTEXT` ,
ADD `crimeJREASON` VARCHAR( 255 ) NOT NULL AFTER `crimeJAILTIME` ;

ALTER TABLE `users`
ADD `jail_reason` VARCHAR( 255 ) NOT NULL AFTER `hospreason` ;

 

 

<?php
/*-----------------------------------------------------
-- Mono Country v1.0 BETA
-- A product of DBS-entertainment
-- Copyright held 2005 by Dabomstew
-- docrime.php edited by Shaved92Bravada 
-----------------------------------------------------*/
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();
$_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 money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c);
}
else
{
if(rand(1, 2) == 1)
{
print $r['crimeFTEXT'];
}
else
{
 print $r['crimeJTEXT'];
 mysql_query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'",$c);
}
}

print "
[url='docrime.php?c={$_GET[']Try Again[/url]

[url='criminal.php']Crimes[/url]";
}
}


$h->endpage();
?>
Link to comment
Share on other sites

Re: [v1]Request For Failing Crime Results to jail

Just an idea....dont know if it will work

but in the query..

 

print $r['crimeJTEXT'];
 mysql_query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'",$c);

 

i dont think that the Time needs to be '' so try nor the userid....

 

 print $r['crimeJTEXT'];
 mysql_query("UPDATE `users` SET `jail` = {$r[crimeJAILTIME]}, `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = $userid",$c);
Link to comment
Share on other sites

Re: [v1]Request For Failing Crime Results to jail

 

If you use this one that I edited for you yesterday then it will send you to jail when you fail.......... sometimes........ its random, sometimes you just fail, sometimes you get thrown in jail. But if I remember correctly on my V1 it didn't come with jail.php so I had to make my own, and it also doesn't come with jail_reason in the user database which you will have to add that in there yourself. Other than that I tested it on my test site and it worked like a charm everytime.

the sql is

 

ALTER TABLE `crimes` 
ADD `crimeJTEXT` TEXT NOT NULL AFTER `crimeFTEXT` ,
ADD `crimeJAILTIME` INT NOT NULL DEFAULT '0' AFTER `crimeJTEXT` ,
ADD `crimeJREASON` VARCHAR( 255 ) NOT NULL AFTER `crimeJAILTIME` ;

ALTER TABLE `users`
ADD `jail_reason` VARCHAR( 255 ) NOT NULL AFTER `hospreason` ;

 

 

<?php
/*-----------------------------------------------------
-- Mono Country v1.0 BETA
-- A product of DBS-entertainment
-- Copyright held 2005 by Dabomstew
-- docrime.php edited by Shaved92Bravada 
-----------------------------------------------------*/
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();
$_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 money={$ir['money']},exp={$ir['exp']} WHERE userid=$userid",$c);
}
else
{
if(rand(1, 2) == 1)
{
print $r['crimeFTEXT'];
}
else
{
 print $r['crimeJTEXT'];
 mysql_query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'",$c);
}
}

print "
[url='docrime.php?c={$_GET[']Try Again[/url]

[url='criminal.php']Crimes[/url]";
}
}


$h->endpage();
?>

 

 

maybe he just miss this then...

SQL

 

ALTER TABLE `users`
ADD `jail` INT(2) NOT NULL AFTER `jail_reason` ;

 

and put the page back the way he orginally had it not the way i said...cuase he might have just forgot a table alter and the page be fine

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...