Jump to content
MakeWebGames

Crimes and there ways


GregFest

Recommended Posts

I feel this should work but it dont can anyone help

<?php
/*
Engine: MC V2.5 (Redux)
File: docrime.php
Author: mccodes.com
*/
if ( !defined($_CONFIG['define_code']) ) {
  echo 'This file cannot be accessed directly.';
  exit;
}
    if ( $ir['jail'] or $ir['hospital'] ) {
  echo 'This page cannot be accessed while in jail or hospital.';
  die($h->endpage());
    }
	$_GET['c'] = ( isset($_GET['c'])&&is_numeric($_GET['c']) )?abs(intval($_GET['c'])):'';
         if ( empty($_GET['c']) ) {
  echo "Invalid crime";
         } else {
  $q = $db->query('SELECT * FROM `crimes` WHERE `crimeID` = '.$_GET['c']);
      if ( $db->num_rows($q) == 0 ) {
  echo 'Invalid Crime';
  die($h->endpage());
      }
  $r = $db->fetch_row($q);
      if($ir['brave'] < $r['crimeBRAVE']) {
  echo "You do not have enough Brave to perform this crime.";
      } else {
     $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","STRENGTH","AGILITY","LABOUR","GUARD","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['Strength'], $ir['Agility'], $ir['Labour'], $ir['Guard'], $ir['IQ']),$r['crimePERCFORM']).";";
     eval($ec);
  echo $r['crimeITEXT'];
     $ir['brave'] -= $r['crimeBRAVE'];
  $db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);
    if ( rand(1,100) <= $sucrate ) {
  echo str_replace("{main}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']);
     $ir['main']+=$r['crimeSUCCESSMUNY'];
     $ir['second']+=$r['crimeSUCCESSCRYS'];
     $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);
  $db->query("UPDATE `users` SET `main` = {$ir['main']}, `second` = {$ir['second']}, `exp` = {$ir['exp']},`crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid",$c);
  if($r['crimeSUCCESSITEM']) {
     item_add($userid, $r['crimeSUCCESSITEM'], 1);
  }
    } else {
   if ( rand(1, 3) == 1 ) {
  echo $r['crimeFTEXT'];
   } else {
if ( rand(1, 3) == 2 ) {
  echo $r['crimeJTEXT'];
  $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");
   }
else {
 echo $r['crimeHTEXT'];
  $db->query("UPDATE `users` SET `hospital` = '$r[crimeHOSPTIME]', `hospreason` = '$r[crimeHREASON]' WHERE `userid` = '$userid'");
    }
 }
 }

  echo "<br /><a href='".gen_url('docrime',true)."&c={$_GET['c']}'>Try Again</a><br /><a href='".gen_url('criminal',true)."'>Crimes</a>";
      }
}
?> 
Edited by Dominion
added tags
Link to comment
Share on other sites

I feel this should work but it dont can anyone help

<?php

/*

Engine: MC V2.5 (Redux)

File: docrime.php

Author: mccodes.com

*/

if ( !defined($_CONFIG['define_code']) ) {

echo 'This file cannot be accessed directly.';

exit;

}

if ( $ir['jail'] or $ir['hospital'] ) {

echo 'This page cannot be accessed while in jail or hospital.';

die($h->endpage());

}

$_GET['c'] = ( isset($_GET['c'])&&is_numeric($_GET['c']) )?abs(intval($_GET['c'])):'';

if ( empty($_GET['c']) ) {

echo "Invalid crime";

} else {

$q = $db->query('SELECT * FROM `crimes` WHERE `crimeID` = '.$_GET['c']);

if ( $db->num_rows($q) == 0 ) {

echo 'Invalid Crime';

die($h->endpage());

}

$r = $db->fetch_row($q);

if($ir['brave'] < $r['crimeBRAVE']) {

echo "You do not have enough Brave to perform this crime.";

} else {

$ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","STRENGTH","AGILITY","LABOUR","GUARD","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['Strength'], $ir['Agility'], $ir['Labour'], $ir['Guard'], $ir['IQ']),$r['crimePERCFORM']).";";

eval($ec);

echo $r['crimeITEXT'];

$ir['brave'] -= $r['crimeBRAVE'];

$db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);

if ( rand(1,100) <= $sucrate ) {

echo str_replace("{main}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']);

$ir['main']+=$r['crimeSUCCESSMUNY'];

$ir['second']+=$r['crimeSUCCESSCRYS'];

$ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);

$db->query("UPDATE `users` SET `main` = {$ir['main']}, `second` = {$ir['second']}, `exp` = {$ir['exp']},`crimexp` = `crimexp` + {$r['crimeXP']} WHERE `userid` = $userid",$c);

if($r['crimeSUCCESSITEM']) {

item_add($userid, $r['crimeSUCCESSITEM'], 1);

}

} else {

if ( rand(1, 3) == 1 ) {

echo $r['crimeFTEXT'];

} else {

if ( rand(1, 3) == 2 ) {

echo $r['crimeJTEXT'];

$db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");

}

else {

echo $r['crimeHTEXT'];

$db->query("UPDATE `users` SET `hospital` = '$r[crimeHOSPTIME]', `hospreason` = '$r[crimeHREASON]' WHERE `userid` = '$userid'");

}

}

}

echo "<br /><a href='".gen_url('docrime',true)."&c={$_GET['c']}'>Try Again</a><br /><a href='".gen_url('criminal',true)."'>Crimes</a>";

}

}

?>

It won't work like that.

your stats shouldn't be $ir['Strength. etc

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.

×
×
  • Create New...