Jump to content

Game Attack Script


Usarjjaco

Recommended Posts

Hello Everyone,I recently received help on here for a way for attacks to randomly occur. However I have come upon my next issue:On activation of the attack redirect the user goes to Attack.phpFrom this screen they are given a random attacker from a list in a MySQL Database. They then click their chosen attack which operates the scriptZattack.phpThis page automatically redirects back to Attack.php after it has ran it's scripts.The problem is I have a database of 100 attackers. And after someone attacks an attacker once and then they are returned to attack page the attacker has changed. How can I keep the attacker current when it is randomly chosen in the beginning of attack.php ?Thanks in advance!

Link to comment
Share on other sites

just pass the attacker information back and forth. The page that chooses an attacker should check to see if one has been passed. If one has, then use that one instead of picking a new one.

Link to comment
Share on other sites

Ok I think I get what you're saying... Just a quick question on the implementation thoughAttack.php gets it's attacker by executingRANDOM () LIMIT 1line of code.Then they commence attack which sends the information of the damage dealt etc to this pageZattack.phpCurrently "Zattack.php" puts the damage in and then returns the player to "attack.php" ... where the RANDOM code line would run again... so how would I let the attack page know who I want after Zattack?I know that I could put the attacker's id as a hidden form field so when they pressed their attack button it would transfer to Zattack.php ... but since Zattack performs the damage actions and automatically redirects how do I get it to pass the information along to attack? If I knew that then I could just use an if statement to execute one script on the page if there is an attacker specified and another script if there is no attacker specified.I'm probably overhthinking this :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...