AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Is there a way 2 block damage from a Weapon? (https://forums.alliedmods.net/showthread.php?t=159375)

2reason2kill 06-16-2011 11:23

[Help] Is there a way 2 block damage from a Weapon?
 
Is there a way 2 block Damage from a deagle or awp?

Devil259 06-16-2011 11:25

Re: [Help] Is there a way 2 block damage from a Weapon?
 
Hook Ham_TakeDamage and return HAM_SUPERCEDE if the weapon is Deagle or Awp.

2reason2kill 06-16-2011 11:28

Re: [Help] Is there a way 2 block damage from a Weapon?
 
Quote:

Originally Posted by Devil259 (Post 1489412)
Hook Ham_TakeDamage and return HAM_SUPERCEDE if the weapon is Deagle or Awp.

O.o Didnt understand could u explain More?

Devil259 06-16-2011 11:39

Re: [Help] Is there a way 2 block damage from a Weapon?
 
An example to explain :

Code:
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers ) new g_iMaxPlayers RegisterHam( Ham_TakeDamage , "player" , "fwTakeDamage" ) g_iMaxPlayers = get_maxplayers() public fwTakeDamage( victim , inflictor , attacker , Float:damage , damage_bits ) {      if( IsPlayer( attacker ) && is_user_alive( attacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_AWP || get_user_weapon(attacker) == CSW_DEAGLE ) )      {           return HAM_SUPERCEDE;      }      return HAM_IGNORED; }


All times are GMT -4. The time now is 23:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.