Okay I made this on my old account cloud the strife...who got banned over a year ago.
So im reposting it.
Description: How to make it so if you are attacking a teamate in castle wars it wont let you. Cape ids 4514, 4516. Not the cloaks with the hoods.
Alright....search for
look a bit down and you will see somthin like this
Code:
if(!nonWild() && !plz.nonWild() && plz != null) {
IsAttacking = true;
inCombat();
}
else {
sendMessage("This player is in a safe zone and cannot be attacked");
}
replace that with this
Code:
if(!nonWild() && !plz.nonWild() && plz != null) {
if(playerEquipment[playerCape] == 4514 && PlayerHandler.players[AttackingOn].playerEquipment[playerCape] == 4514 || playerEquipment[playerCape] == 4516 && PlayerHandler.players[AttackingOn].playerEquipment[playerCape] == 4516) //If both players are wearing the same coloured caslte war cloak, 4514 = blue 4516 = red
{
sendMessage("You can't attack your own team!");
}
else
{
IsAttacking = true;
inCombat();
}
}
else {
sendMessage("This player is in a safe zone and cannot be attacked");
}
Your code may not look like that above so basically its just this
Code:
if(playerEquipment[playerCape] == 4514 && PlayerHandler.players[AttackingOn].playerEquipment[playerCape] == 4514 || playerEquipment[playerCape] == 4516 && PlayerHandler.players[AttackingOn].playerEquipment[playerCape] == 4516) //If both players are wearing the same coloured caslte war cloak, 4514 = blue 4516 = red
{
sendMessage("You can't attack your own team!");
}
else
{
then after that last "else" you have to end it with another "}", which you should know how to do.
Thats for people wearing the same castle wars cloak ids 4514, and 4516. if they are wearing the same cloak then they can't attack each other.