Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: edit item form to only edit the weapon power or armor strength  (Read 494 times)

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
edit item form to only edit the weapon power or armor strength
« on: November 18, 2009, 11:38:38 AM »
im trying to create a form that will allow players to upgrade their weapons for a price of some kind and im having a bit of trouble getting it to work...i started with the staff items php and picked out pieces of code that shouldnt be there, but that is apparently problematic...ive gotten it to the point where it will select only the items in my inventory and move to the edit item submit form...but at this point it does not post the current weapon power in the input box and i get an error when trying to submit it...i havent worked on making it charge them for it yet, because if this part doesnt work then its useless to try and code that out. has anyone done this or have any suggestions on how to attack this mod? i dont have the exact error for you right now but basically i get a sql error with a whole lot of '','','','',''.,'',''.''. except for the weapon power seems to post to the script...is there a way to copy the item exactly and rename it with an auto increment of +1 thereby creating a new item new item id . example rusty dagger with id 1 becomes rusty dagger +1 id "#" whatever is next in line and then obviously remove the old item from inventory and replace with new item...this is pretty much the important portion i think i can reason out the rest
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: edit item form to only edit the weapon power or armor strength
« Reply #1 on: November 18, 2009, 01:30:08 PM »
You could always just copy the create_item sub form and remove the obvious like....item name...item description etc.  Just leave the boxes for them to upgrade it to and adjust your insert into the database accordingly.

May even be easier to use the Edit Item subform

ReignFire

  • Basic Member
  • *
  • Reputation Power: 36
  • ReignFire has no influence.
  • Offline Offline
  • Posts: 56
    • View Profile
Re: edit item form to only edit the weapon power or armor strength
« Reply #2 on: November 18, 2009, 02:01:07 PM »
thats pretty much what ive done...but im getting a gigantic error on the INSERT INTO items Values query... :(
Logged

JoshuaDams

  • Active Member
  • **
  • Reputation Power: 129
  • JoshuaDams is working their way up.JoshuaDams is working their way up.JoshuaDams is working their way up.
  • Offline Offline
  • Posts: 240
    • MSN Messenger - immortalthug4ever@hotmail.com
    • View Profile
    • WWW
Re: edit item form to only edit the weapon power or armor strength
« Reply #3 on: November 19, 2009, 02:25:53 AM »
If you can get the error i might be able to tell you the prob :p
 


This forum is now closed and has moved to a new location! Click here to find out why.