Jump to content
MakeWebGames

Attacks into Units


peterisgb

Recommended Posts

on attack php, you can change the attack units,

Default it /2 which is 50%

i've changed mine into /5 which is 20 Energy

, is there a way that it can only just use one attack

though something like this would work but i'm not sure now,

print "<table width=100%><tr><td colspan=2 align=center>";

if($_GET['wepid'])

{

if($_SESSION['attacking']==0 && $ir['attacking'] == 0)

{

if ($youdata['energy'] >= $youdata['maxenergy']/10000)

{

$db->query("UPDATE users SET energy=energy-1 WHERE userid=$userid");

$_SESSION['attacklog']="";

$_SESSION['attackdmg']=0;

}

else

{

print "You can only attack someone when you have 1 energy";

$h->endpage();

exit;

this wont work i beleive, but is it possible and how would i go about doing this?

Link to comment
Share on other sites

weapon/sec weapon/ armor are called from the user dbase

If you wanted to take this away from the users table it then starts getting complex

You would need 2 new tables one called weapons and one called userweapons

You would then need to rewrite the attack.php so that it can grab info on userweapons if they are equipped or not.

However this isnt a bad thing cos with the new setup you could add attributes to your new weapons that you couldnt really achieve with the mcc version.

Files that would need changing are.

staff_items.php you would need to remove the weapons section and create a new file called staff_weapons.php

Inventory.php would need to be rewritten.

as would equip_armor.php and equip_weapon.php

so as you can see it does start getting very complicated..

BUT its do-able and could open a new way and an improved way of the attack system..

Link to comment
Share on other sites

weapon/sec weapon/ armor are called from the user dbase

If you wanted to take this away from the users table it then starts getting complex

You would need 2 new tables one called weapons and one called userweapons

You would then need to rewrite the attack.php so that it can grab info on userweapons if they are equipped or not.

However this isnt a bad thing cos with the new setup you could add attributes to your new weapons that you couldnt really achieve with the mcc version.

Files that would need changing are.

staff_items.php you would need to remove the weapons section and create a new file called staff_weapons.php

Inventory.php would need to be rewritten.

as would equip_armor.php and equip_weapon.php

so as you can see it does start getting very complicated..

BUT its do-able and could open a new way and an improved way of the attack system..

oh, well that was the idea, cos i was wanting something like, go mining and get minerals like iron, copper, tin etc to be able upgrade the weapons,

but i cant do this, my knowledge of php aint that good yetm i'm still learning as of yet

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