- Joined
- Apr 16, 2007
- Messages
- 441
- Reaction score
- 204
So basically this code will make it so that if you accidentally shoot a clan member they take no damage.
Everything here is server-sided open WarZ_Server.sln
ServerGameLogic.cpp (Search for)
Add under it:
Everything here is server-sided open WarZ_Server.sln
ServerGameLogic.cpp (Search for)
Code:
if((targetPlr->loadout_->GameFlags & wiCharDataFull::GAMEFLAG_NearPostBox) && !force_damage)
return false;
Add under it:
Code:
// if you are the one inflicting damage to yourself ex: Grenade
if(targetPlr->ID == IsServerPlayer(fromObj)->ID)
{
//since you are inflicting dmg to yourself take the damage
return true;
}else{
//We should do a ClanID empty value check before hand
//If the enemy is not in a clan just inflict damage
//The reason why we do this is if players who are not in a clan their ClanID returns the same //so it turns the game into a PVE.
if(!*targetPlr->loadout_->ClanID)
return true;
//If targetPlr's ClanID is not empty continue
//After the checks, we check for both the atker/victim's ClanID
if(targetPlr->loadout_->ClanID == IsServerPlayer(fromObj)->loadout_->ClanID)
//If player's ClanID = the same take no damage
return false;
}
Last edited: