Jump to content
MakeWebGames

Returning values


lucky3809

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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