Raised This Month: $ Target: $400
 0% 

Can someone explain this hook to me?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Santaaa
BANNED
Join Date: May 2012
Old 07-14-2012 , 16:43   Can someone explain this hook to me?
Reply With Quote #1

Hey there,

I would like to know more about this event. Example how to catch the victim, how to set hitboxes. etc
PHP Code:
RegisterHam(Ham_TraceAttack"player""FwdTraceAttack"
Santaaa is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-14-2012 , 16:53   Re: Can someone explain this hook to me?
Reply With Quote #2

PHP Code:
public FwdTraceAttack(idvictimidattackerFloat:damageFloat:direction[3], traceresultdamagebits
First param is the victim id.


To set the hitbox use:

PHP Code:
set_tr2(traceresult,TR_iHitGroup,HIT_*) 
Where HIT_* is the hitplace (see amxconst.inc):

PHP Code:
/* Parts of body for hits */
#define HIT_GENERIC  0 /* none */
#define HIT_HEAD  1
#define HIT_CHEST  2
#define HIT_STOMACH  3
#define HIT_LEFTARM  4
#define HIT_RIGHTARM  5
#define HIT_LEFTLEG  6
#define HIT_RIGHTLEG  7 
__________________
<VeCo> is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-14-2012 , 17:28   Re: Can someone explain this hook to me?
Reply With Quote #3

So for example

PHP Code:
if (!get_tr2(traceTR_iHitGroup) == HIT_HEAD
Would block everything what is not hitting the head?
Santaaa is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-15-2012 , 06:34   Re: Can someone explain this hook to me?
Reply With Quote #4

!=

So, yes, if you supercede the function you will block shooting the head.
__________________
<VeCo> is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-15-2012 , 06:46   Re: Can someone explain this hook to me?
Reply With Quote #5

PHP Code:
#define HIT_SHIELD  8 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 15:23.


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