Jump to content
MakeWebGames

War mod help


newttster

Recommended Posts

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