Jump to content
MakeWebGames

Docrime.php help


SHAD

Recommended Posts

Ok i have 3 different sucess texts, and they are called "crimeSTEXT" "crimeSSTEXT" "crimeSSSTEXT".

But how do i add these in the docrime.php, so it selects one of these at random.

 

 <?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']);
echo'
<span style="font-variant: small-caps;"><h2>Crimes</h2></span>';

print"
<hr color=#303030 width=85%/>
";
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"<font color=green>[b]";
$ir['brave']-=$r['crimeBRAVE'];
mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);
if(rand(1,175) <= $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);
print"</font>";
if($r['crimeSUCCESSITEM'])
{
 item_add($userid, $r['crimeSUCCESSITEM'], 1);
}
}
else
{
if(rand(1, 2) == 1)
{
print"<font color=brown>";
print $r['crimeFTEXT'];
print"</font>";
}
else
{
print"<font color=red>"; 
print $r['crimeJTEXT'];
print"</font>";
$db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");
}
}
print "

";

print "
<hr color=#303030 width=85%/>[url='docrime.php?c={$_GET[']• Try Again[/url]
[url='crimes.php']• Crimes[/url]<hr color=#303030 width=85%/>";
}
}print"
";


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

I thought it already picked the outcome at random

Yea it does,but it only has a single outcome for success text,and i have made 3 but i dont know how to implant them in to docrime.php so it select one of those success texts instead of selecting just one sucess text.

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