Jump to content
MakeWebGames

Recommended Posts

Posted

I wanted to display in my inventory the stats or each primary wep, secondary wep and armour so users know what the stats of their items are when equipped

I dont know where to start can someone help me?

MC V2 btw...

Posted

I didnt understand what you said can you show me an example basically i would want to see what item is equipped in the slots, for weapon it would be the weapon power + strength giving a total weapon damage... same with the rest armour power + guard

Posted

Maybe this (quick shot in the dark) for the primary weapon for example

$a=$db->query("SELECT * FROM `items` WHERE `weapon` IN({$ir['equip_primary']}

$pwpower=$db->fetch_row($a)

Then display the variable $pwpower as the weapon power? It wouldn't be too tough to just pull the user's Strength and add it to the displayed total.

Posted (edited)
Maybe this (quick shot in the dark) for the primary weapon for example

$a=$db->query("SELECT * FROM `items` WHERE `weapon` IN({$ir['equip_primary']}

$pwpower=$db->fetch_row($a)

Then display the variable $pwpower as the weapon power? It wouldn't be too tough to just pull the user's Strength and add it to the displayed total.

Won't work, as $ir['equip_primary'] is the ID of the item.

 

$get = $db->query("SELECT `weapon`,`armor` FROM `items` WHERE `itmid`={$ir['equip_primary']}");
$r = $db->fetch_row($get);
echo 'Power: '. $r['weapon'] . PHP_EOL .'
     Guard: '. $r['armor'];
Edited by sniko

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