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

Don't display blood on damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
N1ghtmr1
Member
Join Date: Nov 2005
Old 06-20-2008 , 12:23   Don't display blood on damage
Reply With Quote #1

Hello

I would like to make a player miss the opponent in x% of the times. This means when a player misses an opponent there should:
1) Not be inflicted any damage
2) Not be any slowdown
3) Not be displayed blood decals.

I've solved first and second by hooking Ham_TakeDamage and setting victims speed on hit. I'm unsure how to deal with the 3). I've tryed different solutions but noone worked, so solutions are welcome

The problem is: How do i block blood decals from appering when a player hits an opponent.

Thanks in advance.
N1ghtmr1 is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-20-2008 , 12:28   Re: Don't display blood on damage
Reply With Quote #2

Can't you set him godmode?
__________________
DA is offline
N1ghtmr1
Member
Join Date: Nov 2005
Old 06-20-2008 , 12:44   Re: Don't display blood on damage
Reply With Quote #3

The problem is, it's only on some shots there should be no blood/damage. Setting godmode would be the same as setting hitzones to 0, but that would apply for everyone hitting that player, and not only the player who misses (even if it cancelled out very fast).

I need to hook an event, which is called JUST before the player is hit, so I can override it, OR make sure, even if the player is hit, that no blood is displayed.

I've played around with Ham_DamageDecal, but it doesn't seem to have any effect.
N1ghtmr1 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-20-2008 , 14:56   Re: Don't display blood on damage
Reply With Quote #4

Just hook Ham_TraceAttack event and handle the trace...so if has chance to miss modify the trace set_tr2(...)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-20-2008 , 15:19   Re: Don't display blood on damage
Reply With Quote #5

Quote:
Originally Posted by Alka View Post
Just hook Ham_TraceAttack event and handle the trace...so if has chance to miss modify the trace set_tr2(...)
This will prevent you to hook Ham_TakeDamage as well ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-20-2008 , 15:26   Re: Don't display blood on damage
Reply With Quote #6

Quote:
Originally Posted by connorr View Post
This will prevent you to hook Ham_TakeDamage as well ;)
Ye, but just for what he said should be enough...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
N1ghtmr1
Member
Join Date: Nov 2005
Old 06-20-2008 , 15:43   Re: Don't display blood on damage
Reply With Quote #7

Thanks, that works very well. I'm not sure if the method I manipulate set_tr2 is the best, but atleast it works ;)

Code for people trying to achieve the same

Code:
public plugin_init() 
{
	RegisterHam(Ham_TraceAttack, "player","Ham_TraceAttack_F")	
}

public Ham_TraceAttack_F(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits)
{
	set_tr2(traceresult,TR_vecEndPos,{0.0, 0.0, 0.0})
	ExecuteHam(Ham_TraceAttack, this, idattacker, damage, direction, traceresult, damagebits);
	return HAM_SUPERCEDE
}
N1ghtmr1 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-20-2008 , 17:03   Re: Don't display blood on damage
Reply With Quote #8

yes is good, you can also make set_tr2(traceresult, TR_flFraction, 1.0);
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 06-20-2008 , 18:37   Re: Don't display blood on damage
Reply With Quote #9

is there reason why you don't supercede the entire thing?
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-28-2009 , 10:19   Re: Don't display blood on damage
Reply With Quote #10

is there a way to block only one player from bleeding with code above?
Owyn is offline
Send a message via ICQ to Owyn
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 12:04.


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