Jump to content
MakeWebGames

Weapon info


peterisgb

Recommended Posts

hi,

I'm trying to add Weapon Power into a page but the code for some reason does not work,

as i'm still learning it could be tottally wrong,

heres the code

 

$p=$db->query("SELECT * FROM items WHERE itmid IN({$ir['weapon']})");

while($h=$db->fetch_row($p))

{

$equip[$r['itmid']]=$h;

}

the table is items and the query is called weapon,

thanks

Link to comment
Share on other sites

Well, as this is mccodes, the field names for you weapons are;

 

  • equip_primary
  • equip_secondary

 

This is with by default anyway, unsure if you've changed it.

Now, to select the weapon power from an item, you would do;

 <?php
/*
* Make sure $ir is global'd, if needed.
* Show weapon power
*/
$get = $db->query("SELECT `weapon` FROM `items` WHERE `itmid`={$ir['equip_primary']}");
$r = $db->fetch_row($get);
echo "Item Power: {$r['weapon']}";
?>

 

And that will display your weapon power.

Sniko.

  • Like 1
Link to comment
Share on other sites

Well, as this is mccodes, the field names for you weapons are;

 

  • equip_primary
  • equip_secondary

 

This is with by default anyway, unsure if you've changed it.

Now, to select the weapon power from an item, you would do;

 <?php
/*
* Make sure $ir is global'd, if needed.
* Show weapon power
*/
$get = $db->query("SELECT `weapon` FROM `items` WHERE `itmid`={$ir['equip_primary']}");
$r = $db->fetch_row($get);
echo "Item Power: {$r['weapon']}";
?>

 

And that will display your weapon power.

Sniko.

Works a charm, thanks sniko +1

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