Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-02-2010 , 18:54   Ham_TakeDamage
Reply With Quote #1

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 !

Last edited by Mxnn; 08-02-2010 at 20:49.
Mxnn is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 08-02-2010 , 20:02   Re: Ham_TakeDamage
Reply With Quote #2

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.

Last edited by RedRobster; 08-03-2010 at 11:26. Reason: :/
RedRobster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-02-2010 , 20:07   Re: Ham_TakeDamage
Reply With Quote #3

Quote:
Originally Posted by Mxnn View Post
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.
__________________
fysiks is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-02-2010 , 20:51   Re: Ham_TakeDamage
Reply With Quote #4

Jajaj, thanks fysiks but the main idea was the function's parameters and the others questions .
Can anyone answer me the questions ? I need it ^^
Mxnn is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 08-02-2010 , 20:55   Re: Ham_TakeDamage
Reply With Quote #5

http://forums.alliedmods.net/showpos...8&postcount=71
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-03-2010 , 04:27   Re: Ham_TakeDamage
Reply With Quote #6

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


Last edited by Jack86; 08-03-2010 at 04:30.
Jack86 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2010 , 05:43   Re: Ham_TakeDamage
Reply With Quote #7

Inflictor is NOT the weapon entity.
Inflictor is Attacker.
Only when it is a HE grenade, inflictor is the grenade entity index.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-03-2010 , 08:07   Re: Ham_TakeDamage
Reply With Quote #8

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.
__________________

Last edited by Arkshine; 08-03-2010 at 08:12.
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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