AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [question] how to get hit zones (https://forums.alliedmods.net/showthread.php?t=276546)

indraraj striker 12-23-2015 05:52

[question] how to get hit zones
 
i want to know how to detect hit zone

chest zone
stomach zone
arm zone
leg zone

example:
PHP Code:

if(chest zone)
do 
stuff
else if (stomach zone)
do 
stuff
else if (arm zone)
do 
stuff
else 
do 
stuff 

Thanks

NiHiLaNTh 12-23-2015 06:37

Re: [question] how to get hit zones
 
you have to hook TraceAttack. Than you can retrieve the hitgroup by using TR_iHitgroup.

Code:

new hitgroup = get_tr2(trace, TR_iHitgroup)

switch (hitgroup)
{
          case HIT_HEAD:            //headshot
          case HIT_CHEST:          //
          //etc. 
}



All times are GMT -4. The time now is 17:55.

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