[Release] Enable Zombie Grenade/RPG/Melee Headshot/Bodyshots Damage

Results 1 to 2 of 2
  1. #1
    Account Upgraded | Title Enabled! Aznkidd235 is offline
    MemberRank
    Apr 2007 Join Date
    518Posts

    [Release] Enable Zombie Grenade/RPG/Melee Headshot/Bodyshots Damage

    This code will allow players to throw nades/rpg/melee head shot/body shots and damage the zombie.

    Everything here is server-sided open WarZ_Server.sln

    sobj_Zombie.cpp (Search for)
    Code:
    bool obj_Zombie::ApplyDamage(GameObject* fromObj, float damage, int bodyPart, STORE_CATEGORIES damageSource)
    {
        if(ZombieState == EZombieStates::ZState_Dead)
            return false;
        
        float dmg = damage;
    (optional) if you guys want zombie body shots to inflict damage add this under the code above
    Code:
    //If shots/dmg were body shots
    if(bodyPart!=1)
    //we want to half the damage value
            dmg = (dmg/2);
    (optional) if you guys want to enable melee headshots/Grenades/RPG
    sobj_Zombie.cpp (Search for)
    Code:
     // only hitting head will lower zombie's health
    // this is the worst code preventing everything remove it
    if(bodyPart !=1)
        {    
            dmg = 0;
        }
    
    //find and remove this code also
    if(damageSource != storecat_MELEE && bodyPart == 1) // everything except for melee: one shot in head = kill
    {
          dmg = 1000;
    }
    Replace that code above with or comment them out.
    Code:
    // everything headshot is death
    if(bodyPart == 1) 
            dmg = 1000;
    Last edited by Aznkidd235; 27-05-14 at 02:20 AM.


  2. #2
    Developer DNC is offline
    DeveloperRank
    Oct 2011 Join Date
    2,493Posts

    Re: [Release] Enable Zombie Grenade/RPG/Melee Headshot/Bodyshots Damage

    You write compact like I do. I like your coding, its clean and easy to follow
    +1 Great work



Advertisement