newttster Posted September 20, 2012 Share Posted September 20, 2012 (edited) Okay ... one of the things that I have been struggling to get to work is the way the attacks work. The way I want it to work is this; Gang A and B are at war. Gang A player can hit Gang B player, Player C and Player D and another member of Gang A Gang B player can hit Gang A player, Player C and Player D and another member of Gang B Player C can hit Player D but not Gang A player or Gang B player Player D can hit Player C but not Gang A player or Gang A player So ... it all works except for Gang A Player being able to hit another member of Gang A or Gang B Player being able to hit another member of Gang B. This is the code that has the above working. $t=($db->fetch_row($db->query("SELECT * FROM gangwars WHERE (warDECLARER={$them['gang']} OR warDECLARED={$them['gang']})"))); if(($them['gang'] == $t['warDECLARER']) AND ($me['gang']!= $t['warDECLARED']) OR ($them['gang'] == $t['warDECLARED']) AND ($me['gang']!= $t['warDECLARER'])) { echo"This players gang is at war. You cannot attack them unless you are in the same war.<br /> <a href='explore.php'>Back to town</a><br /> $h->endpage(); $_SESSION['attacking']=0; $me['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } I have tried all the variations that I can think of to accomplish the final bit where Players can attack their own gang members during war ... and I just can't see how to do this. Any ideas would be appreciated. Edited September 22, 2012 by newttster Quote Link to comment Share on other sites More sharing options...
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.