Jump to content
MakeWebGames

[mccode v2] Item needed to perform crime.


shaved92bravada

Recommended Posts

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.

Link to comment
Share on other sites

  • 4 months later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...

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.

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