Jump to content
MakeWebGames

FREE Criminal Record (advanced)


oxidati0n

Recommended Posts

This is a advanced criminal record.

Works like a charm and is very useful. :)

1) Execute Query

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

2) Create file "criminalrecord.php"

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

3) replace docrime.php with this

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

4) open criminal.php and find where it says

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

add below

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

There you go, your done! :)

Works 100% Guaranteed!

Link to comment
Share on other sites

  • 1 month later...

Re: [mccode] FREE Criminal Record (advanced)

 

Man that's inefficient :|

Im not surprised so many people get kicked off their servers

What do you call efficent then :|

A script's a script.

The things I would do differently include..... (based of a very quick review)

Not having an Insert for every single crime outcome. Instead, have one row per user. Do not insert unless there is no pre-existing entry. Otherwise, simply increment a counter for success or fail. That will significantly reduce the query needs when you go to report the ratios. I guess you're not even tracking failures but you could easily track both and still end up with more efficient queries

In addition, doing a select * from a table when you do not need every field is wasted processing as well.

Link to comment
Share on other sites

  • 4 weeks later...

Re: [mccode] FREE Criminal Record (advanced)

Well OXI

There is a bug on there, on docrime.php you created for this...

The user does not get NO EXP at all when they do a crime, I don't know if you want it to be like that but I think people would like it like that :-D

Just a thought :mrgreen:

Link to comment
Share on other sites

  • 1 month later...

Re: [mccode] FREE Criminal Record (advanced)

here i fixed the prob.. the exp should load for u now

<?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 "

Try Again

Crimes";

}print "Criminal Record

";

mysql_query("INSERT INTO `criminalrecord` (`crime`, `user`, `succeeded`) VALUES ('$_GET[c]', '$userid', '$succ');",$c);

}

 

$h->endpage();

?>

Link to comment
Share on other sites

  • 3 months later...

Re: [mccode] FREE Criminal Record (advanced)

Theres a few bugs with this, i've fixed the exp one.

It always inserts 0 for your success even if you have failed or succeeded.

$succ="0"

Don't really know what you would change that to.

 

If a crime has already been done by someone else it won't insert again.

Link to comment
Share on other sites

  • 5 months later...

Re: Criminal Record [V2]

Ive tried this criminal record, but it didn't work for me. So ive slightly changed it and got it to work.

SQL:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Replace docrime.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add criminalrecord.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

  • 6 months later...
  • 6 years later...

Replace:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

With

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

then replace:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

then replace

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

then replace

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

with

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

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