Jump to content
MakeWebGames

Recommended Posts

Posted

I have seen a request for this and I am not sure if its been made or not. So I went ahead and made it anyway. Its pretty simple over all, just thought it would be a nice addition. As always if ya don't like it or the way I did it then ya don't have to use it. If ya like it then you are more than welcome to use it. Everything has been tested except for the create new crime functions. only because I don't need anymore crimes at the moment. I am sure it will work though. If you have any problems feel free to post them here and I will gladly help. I know its not the prettiest of programming but hey I am still learning.

The SQL

 

You're unable to view this code.

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

 

open criminal.php

find

You're unable to view this code.

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

 

add this below

 

You're unable to view this code.

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

 

Now for the part that shows it

find this

 

You're unable to view this code.

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

 

replace with this

 

You're unable to view this code.

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

 

find this

 

You're unable to view this code.

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

 

replace with this

 

You're unable to view this code.

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

 

Now open docrime.php

find

 

You're unable to view this code.

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

 

replace with this

 

You're unable to view this code.

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

 

That will take care of not being able to do the crime if you don't have that item. Now for the staff_crimes

open staff_crimes.php

and replace functions: new_crime_form() , new_crime_submit() , edit_crime_begin() , edit_crime_form() , edit_crime_sub()

with whats below. I found it easier just to post it this way rather than each individual edit to the 4 required functions.

 

You're unable to view this code.

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

Posted

Re: [mccode V2] Item needed to perform crime.

Thanks let me know if there are any bugs or anything wrong. I did this pretty quickly in an effort to get it done and posted. Like I said I tested it on mine all except for the create crime functions and it all seemed to work pretty well.

Posted

Re: [mccode V2] Item needed to perform crime.

well I guess that is a good sign lol. Not really any posts about bugs or it not working..... if ya like it and are using it let me know how you like it as I got some more ideas in mind for some simple mods.

Posted

Re: [mccode V2] Item needed to perform crime.

Nice, ive been meaning to get round to doing this for ages.

will give it a go later and let you know.

thanks +1

  • 4 months later...
Posted

Re: [mccode v2] Item needed to perform crime.

Well i know this is an old mod but ive just installed it and id like to show my appreciation for the coder if he is still around

Thanks mate i love it

Posted

Re: [mccode v2] Item needed to perform crime.

 

$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

{

I've just tried it out.

It's just this bit that's bugging me it alway's say's invalid item even when its set to None

EDIT:Works when there is an item just not when its set to None :S

Any help around lol

Posted

Re: [mccode v2] Item needed to perform crime.

 

Can anybody help?

I'll pay $5 for it.

Should'nt be too hard to do should it?

I dont want paying for the help but whats your website

Posted

Re: [mccode v2] Item needed to perform crime.

 

$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

{

I've just tried it out.

It's just this bit that's bugging me it alway's say's invalid item even when its set to None

EDIT:Works when there is an item just not when its set to None :S

Any help around lol

 

typo this bit of code...

 

You're unable to view this code.

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

 

should be

 

You're unable to view this code.

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

 

$n=$db->fetch_row($qi); was $n=$db->fetch_row($qn); so it was trying to fetch something that hadn't been declared hence erroring out with saying no item

Posted

Re: [mccode v2] Item needed to perform crime.

Thanks shrek1609!

The problem im talking about is that if i want to have a crime that doesnt need an item it wont let me.

Note: works fine with an item

Ill set it as have "none" in the DB and it says i dont have the required item :S

Ive had a stab at this myself but cant figure it out.

Posted

Re: [mccode v2] Item needed to perform crime.

ok not tested this but just from reading through the code appears it will only work if an item is needed for the crime to be done...

try this should fix it, as long as you set the crimeITEM as 0 in database when you don't want an item needed for the crime...

 

You're unable to view this code.

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

 

that should work... :)

Posted

Re: [mccode v2] Item needed to perform crime.

syntax error, unexpected '>' docrime.php on line 20

 

line 20 is:

You're unable to view this code.

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

Posted

Re: [mccode v2] Item needed to perform crime.

 

syntax error, unexpected '>' docrime.php on line 20

 

line 20 is:

You're unable to view this code.

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

 

change to

You're unable to view this code.

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

Posted

Re: [mccode v2] Item needed to perform crime.

 

try this...

if ($r['crimeITEM'] > 0 && $n['inv_itemid'] != $r['crimeITEM'])

:wink:

ahh didn't see your post lol

Posted

Re: [mccode v2] Item needed to perform crime.

that worked except back to the message you don't have the required item even if you do

and your brave can go into the negative

  • 6 months later...
Posted

RE: Re: [mccode v2] Item needed to perform crime.

 

try this...

if ($r['crimeITEM'] > 0 && $n['inv_itemid'] != $r['crimeITEM'])

:wink:

ahh didn't see your post lol

This WILL fix it guys ^^ im glad i could help ;)

 

You're unable to view this code.

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

Posted

Not a big deal here but the original post had:

 

open criminal.php

find

You're unable to view this code.

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

 

you will probably have

<td colspan='3' class='c'> you need to change the 3 to a 4 to get it to display right.

  • 1 month later...
Posted

RE: Re: [mccode v2] Item needed to perform crime.

The item stays in your inventory after you use it. Seems kid of pointless if you can use a bomb as many times as you want.

Posted

It wasn't created in order to "use" an item. It was just created to where you would have to have that certain item in your inventory. Script can be altered in order to "use" the item but then someone would have to get that certain item each time they wanted to do that crime. I haven't been around in a while but I am starting work on created or modifying my current mods.

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