Jump to content
MakeWebGames

Advanced Attack and Inventory Mod--One Click.


Joshua

Recommended Posts

Error:

Query was INSERT INTO items VALUES('',7,'test helmet','test',20,10,0, '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', 0, 0, 10, 0, 0, 0, 0)

Query:

$m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $boots, $helmet, $breastplate, $leggings, $gloves, $armor)");

 

I have looked at the SQL tables in myphpadmin, and IM probably just missing the obvious. Any hints?

Link to comment
Share on other sites

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

thanks :D everything is working fine for me except one thing and thats the give item function. i went to mdk invent thread and found somthing like it and change the give item func code but now i just have a blank screen when i click give item =/ anyone know the solution or experienced this problem?

Link to comment
Share on other sites

Error:

Query was INSERT INTO items VALUES

('',7, this is the ('',{$_POST['itmtype']},

'test helmet', is the '$itmname',

'test', is the $itmdesc',

20, is the {$_POST['itmbuyprice']},

10, is the {$_POST['itmbuyprice']},

0, is the {$_POST['itmsellprice']},

'0', is the $itmbuy,

'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx1',

'0', is the '{$_POST['effect1on']}',

'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx2',

'0', is the '{$_POST['effect2on']}',

'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', is the '$efx3',

0, is the {$_POST['effect3on']}',

0, is the $weapon,

10, is the $boots,

0, is the $helmet,

0, is the $breastplate,

0, is the $leggings,

0) is the $gloves,

I removed the $armor, and still not working.

Link to comment
Share on other sites

Field Type Collation Attributes Null Default Extra Action

itmid int(11) No None auto_increment

itmtype int(11) No 0

itmname varchar(255) latin1_swedish_ci No

itmdesc text latin1_swedish_ci No None

itmbuyprice int(11) No 0

itmsellprice int(11) No 0

itmbuyable int(11) No 0

effect1_on tinyint(4) No 0

effect1 text latin1_swedish_ci No None

effect2_on tinyint(4) No 0

effect2 text latin1_swedish_ci No None

effect3_on tinyint(4) No 0

effect3 text latin1_swedish_ci No None

weapon int(11) No 0

armor int(11) No 0

boots int(11) No None

helmet int(11) No None

breastplate int(11) No None

leggings int(11) No None

gloves int(11) No None

theres my table

Link to comment
Share on other sites

i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out

Link to comment
Share on other sites

Field Type Collation Attributes Null Default Extra Action

itmid int(11) No None auto_increment

itmtype int(11) No 0

itmname varchar(255) latin1_swedish_ci No

itmdesc text latin1_swedish_ci No None

itmbuyprice int(11) No 0

itmsellprice int(11) No 0

itmbuyable int(11) No 0

effect1_on tinyint(4) No 0

effect1 text latin1_swedish_ci No None

effect2_on tinyint(4) No 0

effect2 text latin1_swedish_ci No None

effect3_on tinyint(4) No 0

effect3 text latin1_swedish_ci No None

weapon int(11) No 0

armor int(11) No 0

boots int(11) No None

helmet int(11) No None

breastplate int(11) No None

leggings int(11) No None

gloves int(11) No None

theres my table

Well if thats your table I wouldnt remove the armor as then your going to get the error as the table count is wrong.
Link to comment
Share on other sites

i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out

At a brief glance your looking at the $defence which is deducted from the attacking hit. If its not being deducted as it should then thats the area in question that is not working and I would check the $defence part of the code.

Link to comment
Share on other sites

i noticed that the attack file only adds the primary and secondary weapon in a fight. i added a breastplate with a high number and it didnt change the ammount of damage i take in a fight. same thing for the others. i looked through the code but i couldnt figure anything out

At a brief glance your looking at the $defence which is deducted from the attacking hit. If its not being deducted as it should then thats the area in question that is not working and I would check the $defence part of the code.

i found it. its the $adefense, change

$adefense = $boots+helmet+$breastplate+$leggings+$gloves+0;

to

$adefense = $aboots+$ahelmet+$abreastplate+$aleggings+$agloves+0;

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 2 years later...
  • 4 months later...

Can someone help me with inventory.php? I'm having problems understanding this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Because the query turns out to be:

SELECT * FROM `items` WHERE `itmid` IN(0,0,0,0,0,0)

And that doesn't return anything, resulting in $equip never being set. Help?

Link to comment
Share on other sites

Can someone help me with inventory.php? I'm having problems understanding this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Because the query turns out to be:

And that doesn't return anything, resulting in $equip never being set. Help?

 

Echo the weapon then you can be sure if it is selecting it. such:

echo ''.$equip[$ir['equip_primary']]['itmname'].'';

Also make sure in your database those items are being equipped, if not then the problem is in your equip.php page.

Edited by lucky3809
Link to comment
Share on other sites

Echo the weapon then you can be sure if it is selecting it. such:

echo ''.$equip[$ir['equip_primary']]['itmname'].'';

It's writing out this, so I'm pretty sure:

A non-critical error has occurred. Page execution will continue. Below are the details:

PHP Notice: Undefined variable: equip (8)

Line executed: ../inventory.php:22

None equipped.

Link to comment
Share on other sites

  • 3 weeks later...

i know that this mod is a old mod but i noticed one thing that was never mentioned in this whole thread and that is unequip the items.

so i edited mine and here it is

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I'm not very good at this but i am surprised to notice not one person ever mentioning removing the items.

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