Raised This Month: $51 Target: $400
 12% 

Executing Ham_TakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 06-27-2014 , 02:00   Executing Ham_TakeDamage
Reply With Quote #1

Hello all.
I am trying to execute Ham_TakeDamage like this.
Code:
ExecuteHam(Ham_TakeDamage, iVictim, iAttacker);

Where i am wrong in this.?
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-27-2014 , 02:08   Re: Executing Ham_TakeDamage
Reply With Quote #2

You are missing the other parameters

Code:
	/**
	 * Description:		Usually called whenever an entity takes any kind of damage.
	 *					Inflictor is the entity that caused the damage (such as a gun).
	 *					Attacker is the entity that tirggered the damage (such as the gun's owner).
	 * Forward params:	function(this, idinflictor, idattacker, Float:damage, damagebits);
	 * Return type:		Integer.
	 * Execute params:	ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);
	 */
	Ham_TakeDamage,
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 06-27-2014 , 02:36   Re: Executing Ham_TakeDamage
Reply With Quote #3

Then I must.

Code:
#include <hamsandwich> /*...*/ ExecuteHam(Ham_TakeDamage, iVictim, 0, iAttacker, 0.0, DMG_RADIATION);

And what is [b]Inflictor[b]
__________________

Last edited by ezio_auditore; 07-03-2014 at 03:25. Reason: Fixed My Code
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-27-2014 , 02:59   Re: Executing Ham_TakeDamage
Reply With Quote #4

Re-read the Description as it answer that
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-27-2014 , 04:16   Re: Executing Ham_TakeDamage
Reply With Quote #5

inflictor is the entity that produce a damage. attacker is the owner of inflictor.
If attacker==inflictor, then the damage was inflicted by a player.
HamletEagle is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-27-2014 , 07:20   Re: Executing Ham_TakeDamage
Reply With Quote #6

And for compatibility with other plugins that may hook this event I suggest using ExecuteHamB().
__________________
Black Rose is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 07-03-2014 , 03:28   Re: Executing Ham_TakeDamage
Reply With Quote #7

O.K.

Here is some code for executig Ham_Killed.

Code:
ExecuteHamB(Ham_Killed, iVictim, iKiller, 2);

Here 2 is the shouldgib paramater.
So it makes the kill effect very ugly.
If i change shouldgib paramter to some player index, will it mean that the entity is being killed by a player?
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 07-03-2014 , 04:04   Re: Executing Ham_TakeDamage
Reply With Quote #8

shouldgib only defines whether killed entity should be gibbed or not. It can has 3 values:
GIB_NEVER = 0; never gib regardless last taken damage amount
GIB_NORMAL = 1; gib only when victim has taken very high damage
GIB_ALWAYS = 2; gib regardless last taken damage amount
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
ezio_auditore
Senior Member
Join Date: May 2013
Old 07-04-2014 , 03:12   Re: Executing Ham_TakeDamage
Reply With Quote #9

So changing the ShouldGib paramater should change the killtime effect?
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 07-04-2014 , 04:20   Re: Executing Ham_TakeDamage
Reply With Quote #10

exactly.

Quote:
If i change shouldgib paramter to some player index, will it mean that the entity is being killed by a player?
For that just set iKiller as player index.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Old 07-04-2014, 15:58
meTaLiCroSS
This message has been deleted by meTaLiCroSS. Reason: wront post lol
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 02:51.


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