HUSTLE HARD Posted October 14, 2012 Posted October 14, 2012 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... Quote
realmoflegends Posted October 14, 2012 Posted October 14, 2012 You could dig into the database and pull out the 'weapon' variable of each weapon in the 'item' database, couldn't you? Or do you need more than that? Quote
HUSTLE HARD Posted October 14, 2012 Author Posted October 14, 2012 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 Quote
realmoflegends Posted October 14, 2012 Posted October 14, 2012 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. Quote
sniko Posted October 14, 2012 Posted October 14, 2012 (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 October 14, 2012 by sniko 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.