AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage (https://forums.alliedmods.net/showthread.php?t=134262)

Mxnn 08-02-2010 18:54

Ham_TakeDamage
 
I have a question..
PHP Code:

public plugin_init()
      
RegisterHam("Ham_TakeDamage""player""Player_Hurt")

public 
Player_Hurt(victiminflictorattackerFloat:dmgdmgbits) {
       
      
//Bla bla bla



This is right?

Inflictor is the gun and dmgbits is the body part where the bullet collides?

Another question.

If I put "kill" in console, or I kill me self with the worldspawn. The attacker & the victim are my id?

Thanks !

RedRobster 08-02-2010 20:02

Re: Ham_TakeDamage
 
Inflictor is the entity id of the gun. dmgbits is the type of damage. There are different ones that are used if you drown, get burned, etc.

fysiks 08-02-2010 20:07

Re: Ham_TakeDamage
 
Quote:

Originally Posted by Mxnn (Post 1259790)
I have a question..
PHP Code:

public plugin_init()
      
RegisterHam("Ham_TakeDamage""player""Player_Hurt")

public 
PlayerHurt(victiminflictorattackerFloat:dmgdmgbits) {
       
      
//Bla bla bla



This is right?

Not exactly, check for typos.

Mxnn 08-02-2010 20:51

Re: Ham_TakeDamage
 
Jajaj, thanks fysiks but the main idea was the function's parameters and the others questions :P.
Can anyone answer me the questions ? I need it ^^

DarkGod 08-02-2010 20:55

Re: Ham_TakeDamage
 
http://forums.alliedmods.net/showpos...8&postcount=71

Jack86 08-03-2010 04:27

Re: Ham_TakeDamage
 
U cant get body part with just Ham_TakeDamage, see link above for that

ConnorMcLeod 08-03-2010 05:43

Re: Ham_TakeDamage
 
Inflictor is NOT the weapon entity.
Inflictor is Attacker.
Only when it is a HE grenade, inflictor is the grenade entity index.

Arkshine 08-03-2010 08:07

Re: Ham_TakeDamage
 
Inflictor is the entity that caused the damage : He grenade, custom entity used as projectile. Since there are no bullets, inflictor is the same as attacker for all guns.
Attacker is the entity that triggered the damage.


All times are GMT -4. The time now is 00:12.

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