Jump to content
MakeWebGames

Help needed with crimes


Chris.Bailey

Recommended Posts

<?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']);
  $r = $db->fetch_array($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","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $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, 2) == 1 ) {
  echo $r['crimeFTEXT'];
   } else {
  echo $r['crimeJTEXT'];
  $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' 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>";
      }
}
?>
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...