Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and are struggling to install it? Cronwerks now installs mods for only $3/$2.50. Message Cronus to discuss the details or purchase.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Crimes not giving experience  (Read 367 times)

muthchris

  • Basic Member
  • *
  • Reputation Power: 20
  • muthchris has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Crimes not giving experience
« on: July 26, 2010, 06:40:57 PM »
My crimes are adding experience to the user's database, but the Exp% isn't going up. It was yesterday, then all the sudden it quit. When members attack others they get experience and their EXP% goes up for that. I uploaded my original criminal.php and docrime.php files and it didn't help. So I deleted the crimes database and started it over, it still did not help. Anyone have any clue what the heck happened here and how to fix it? ???
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Crimes not giving experience
« Reply #1 on: July 27, 2010, 07:43:48 AM »
Post your docrime.php
Logged
Project Choosen - 10%
Daniel - Hanson . Com

muthchris

  • Basic Member
  • *
  • Reputation Power: 20
  • muthchris has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Crimes not giving experience
« Reply #2 on: July 27, 2010, 09:27:51 AM »
<?php
$macropage="docrime.php?c={$_GET['c']}";
include "globals.php";
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","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $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['crystals']+=$r['crimeSUCCESSCRYS'];
$ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);
mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, 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)
{
print $r['crimeFTEXT'];
}
else
{
  print $r['crimeJTEXT'];
  $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");
}
}

print "<br /><a href='docrime.php?c={$_GET['c']}'>Try Again</a><br />
<a href='criminal.php'>Crimes</a>";
}
}


$h->endpage();
?>
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Crimes not giving experience
« Reply #3 on: July 27, 2010, 10:17:19 AM »
Wrap it in php tags next time.
And are they gaining any money from the crime?
Logged
Project Choosen - 10%
Daniel - Hanson . Com

muthchris

  • Basic Member
  • *
  • Reputation Power: 20
  • muthchris has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Crimes not giving experience
« Reply #4 on: July 27, 2010, 10:15:13 PM »
sorry I'm not the best, and yes they are getting money
« Last Edit: July 29, 2010, 10:53:35 AM by muthchris »
Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.