Weapon damage

Topic created · 6 Posts · 167 Views
  • Can anyone tell me which file/files store weapon damage?

  • Why? What are you trying to do?
    You could simply override damages dealt with GSC, you don't need to modify game files or whatever.

    An example to disable knife damage
    You can very easily print the available variables in the function arguments to debug it and write your desired logic

    init()
    {
        level.callbackplayerdamagestub = level.callbackplayerdamage;
        level.callbackplayerdamage = ::cancelKnifeDamage;
    }
    
    cancelKnifeDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset )
    {    
        if (sWeapon == "knife_mp")
        { 
            iDamage = 0;
        }
    
        self [[level.callbackplayerdamagestub]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, timeOffset );
    } 
    
  • @Resxt I just wanted to buff the DSR and galvaknuckles, and maybe whatever else i come up with. This script will work, thanks

  • @Resxt Hey i dont mean to bug you but im having a bit of a difficult time with this for some reason. Did searching on the forum but still cant figure it out. Would you mind telling me what I need to change here for it to work? I tried with callbackplayerdamage as well.

    onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )
    {
    	 if (sWeapon == "dsr50_upgraded_zm") //&& isDefined(self.hasSniper)
        { 
            iDamage = 5555;
        }
    	 if (sWeapon == "tazer_knuckles_zm") //&& isDefined(self.hasKnife)
        { 
            iDamage = 7777;
        }
    	return iDamage;
    }
    
  • @chasef7 do you have the init funtion too with matching function names?
    Would be useful if you could print the values you get especially to make sure the funtion is actually called.

    I'm not sure if modifying damage works like that for zombies. I gave you a way to do it for multiplayer since you didn't ask for anything specific but maybe it doesn't work the same in zombies, I really don't know. I'll try to check tonight

  • @chasef7 que hay que hacer con eso para que funcione?

Log in to reply