lucky3809 Posted February 27, 2011 Share Posted February 27, 2011 Need some help I'm trying to return a value to the userstats table... for instance I added 0.8 guard effect to a weapon then when I equip it I times it by the stat that a player already has trained, how do i go about when unequipped it so it takes that amount back off? I've tried $amount=$einfo['inc_amount']*[$einfo['stat']; $db->query("UPDATE `userstats` SET $stats=$stats-$amount WHERE (`userid`=".$_SESSION['userid'].")"); But it's taking off triple the amount, then it suppose to. Quote Link to comment Share on other sites More sharing options...
Paul Evans Posted February 28, 2011 Share Posted February 28, 2011 I'm sorry what is it your doing? Quote Link to comment Share on other sites More sharing options...
Uridium Posted February 28, 2011 Share Posted February 28, 2011 From what im assuming you mean if a player equips a mighty sword then it adds 0.8 to his Guard from the userstats and when unequipped it goes back to its original Stat before item was equipped. The table layout for Items and stats would need a drastic change for this to work Looking at the usual MCC table for items this cant be done. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted March 1, 2011 Author Share Posted March 1, 2011 Thank you Illusion! I have figured it out, it took me time and yes as you said it did need a drasic change had to add another userstats table which has helped me for what I was aiming for!! @ Paul Iam doing the set up roguevampires.net has, when you equip a weapon it adds stat boost and when you unequip it takes that stat boost off. What I was having a problem with was when you unequiped,it didnt take the right value off which is multiplication, stats times the value of the boost, which is impossible how i was doing it lol. so I added another userstats table and it gave me what I was looking for. Quote Link to comment Share on other sites More sharing options...
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.