ItsMods

Full Version: damage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
help what code that would remove the damage from the fall? and the code that is: AK47 takes 500 hp (1 bullet) deagle 3000 hp Done
(05-16-2013, 19:12)Jone Calerone Wrote: [ -> ]help what code that would remove the damage from the fall? and the code that is: AK47 takes 500 hp (1 bullet) deagle 3000 hp Done

you can disable falldamage with the speed plugin or that code should work too:

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5.  
  6. namespace ClassLibrary1
  7. {
  8. public class Class1:CPlugin
  9. {
  10. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
  11. {
  12. if (DamageMod == "MOD_FALLING")
  13. {
  14. Damage = 0;
  15. }
  16. if (Weapon.Contains("ak47"))
  17. {
  18. Damage = 500;
  19. }
  20. if (Weapon.Contains("deserteagle"))
  21. {
  22. Damage = 3000;
  23. }
  24. return Damage;
  25. }
  26. }
  27. }


I didn't test the falling stuff though
(05-16-2013, 19:25)8q4s8 Wrote: [ -> ]
(05-16-2013, 19:12)Jone Calerone Wrote: [ -> ]help what code that would remove the damage from the fall? and the code that is: AK47 takes 500 hp (1 bullet) deagle 3000 hp Done

you can disable falldamage with the speed plugin or that code should work too:

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5.  
  6. namespace ClassLibrary1
  7. {
  8. public class Class1:CPlugin
  9. {
  10. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
  11. {
  12. if (DamageMod == "MOD_FALLING")
  13. {
  14. Damage = 0;
  15. }
  16. if (Weapon.Contains("ak47"))
  17. {
  18. Damage = 500;
  19. }
  20. if (Weapon.Contains("deserteagle"))
  21. {
  22. Damage = 3000;
  23. }
  24. return Damage;
  25. }
  26. }
  27. }


I didn't test the falling stuff though

In MW2(maybe mw3 too) 'MOD_TRIGGER_HURT' is also fall damage. I don't know why.