Jump to content
MakeWebGames

Problems with doing Crimes


Bwerk01

Recommended Posts

Hello,

I have been having a problem with the crimes on my game. When I do the crime and succeed I have it set so that it will give 25 EXP, however, when I watch the EXP it only goes up 2 EXP. Anyone know why this may be? Here is my docrime.php code.

<?php
$macropage="docrime.php?c={$_GET['c']}";
include "globals.php";
if($ir['jail'] or $ir['hospital']) { die("You cannot perform crimes while in jail or the 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 Nerve 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 "
[url='docrime.php?c={$_GET[']Retry[/url]

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


$h->endpage();
?>

 

Any help would be greatly appreciated. I searched and was unable to find anyone having the same problem as me.

Link to comment
Share on other sites

Re: Problems with doing Crimes

looks to me like its only awarding the successmoney divided by 8.

So your success money is probably 16 so its awarding two exp. You need to change

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

to

 

$ir['exp']+=(int) ($r['crimeREGXP']);

I believe crimeREGXP is the default field for mcv2 that contains the amount of regular exp to be rewarded.

Link to comment
Share on other sites

Re: Problems with doing Crimes

dont know if this is the case but im just trying to help...

you might want to leave it as it was. there is the normal xp helping you level up and the crimes xp.

When you add a crime you setup the Crime XP not the normal xp. You dont see the amount of crimes xp you setup unless you mod it i guess.

make sure you dont receive like %20 xp for a crime or you might end up with people being level 1000 in a few weeks.

put

Crime XP: <?= $ir['crimexp'] ?>

in your index somewhere and you should see the crimes xp gaining as much as you set it up to when creating a crime.

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...