Uridium Posted May 11, 2008 Posted May 11, 2008 Ok so ive been banging my brains for days trying to solve this thing and finally I managed it :) Firstly open up smenu.php Just After this line > Add Item Type "; Add remove the "; before Adding next line > Delete Item Type "; Then Open Your staff_items.php Look for case 'newitemtype': newitemtype(); break; Then Add This Line Underneath it. case 'remitemtype' : rem_item_type(); break; Then just before $h->endpage(); Add this Coding function rem_item_type() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['remname']) { $d=$db->query("SELECT * FROM itemtypes WHERE itmtypename='{$_POST['remname']}'"); while($a=mysql_fetch_array($d)) { $db->query("DELETE FROM itemtypes WHERE itmtypeid='{$a['itmtypeid']}'"); print "Item Type {$_POST['remname']} Was Sucessfully Removed."; } stafflog_add("Removed item type {$_POST['remname']}"); print "<h3>Remove Item Type</h3><hr /> <form action='staff_items.php?action=remitemtype' method='post'> Name: <input type='text' name='remname' /> <input type='submit' value='Remove Item Type' /></form> "; } else { print "<h3>Remove Item Type</h3><hr /> <form action='staff_items.php?action=remitemtype' method='post'> Name: <input type='text' name='remname' /> <input type='submit' value='Remove Item Type' /></form> "; so that the Bottom final part looks like } } $h->endpage(); ?> You can Now Delete Item Types from the game without going into phpmyadmin.. Quote
~Destiny-Gaming~ Posted May 11, 2008 Posted May 11, 2008 Re: Edit Item Type Code Solved Nice Extra Feature Good One! Quote
Magictallguy Posted May 11, 2008 Posted May 11, 2008 Re: Edit Item Type Code Solved Nicely done :) Quote
Uridium Posted May 12, 2008 Author Posted May 12, 2008 Re: Edit Item Type Code Solved Id like some feed back on this as its my First attempt at solving anything on the MCC. If anyone received error messages whilst applynig the above code and so on. I tested it on Firefox and IE and it worked fine for me. Quote
Haunted Dawg Posted May 12, 2008 Posted May 12, 2008 Re: Edit Item Type Code Solved You should do a edit item type now. Quote
Uridium Posted May 12, 2008 Author Posted May 12, 2008 Re: Edit Item Type Code Solved Actually lol im already in the process of doing that one lol May also include an Add Picture to Item Type aswell now that ive got the Picture one solved from this post http://criminalexistence.com/ceforums/index.php?topic=18505.0 Quote
Uridium Posted April 29 Author Posted April 29 Damn my first ever working script for mccodes on ctiminalexistence forums back in the day 🙂 soon to be 17 years Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.