AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved TraceHull's TR_pHit (https://forums.alliedmods.net/showthread.php?t=329842)

ConorCC 01-10-2021 05:35

TraceHull's TR_pHit
 
TraceHull's TR_pHit returns only world (-1) and non player entities' ID.

Code:

static trace; trace = create_tr2();
engfunc(EngFunc_TraceHull, origin, end_new, IGNORE_MONSTERS, HULL_HEAD, id, trace);
static hit; hit = get_tr2(trace, TR_pHit);
client_print(0, print_chat, "HIT BY TRACE: %i", hit);

This one should every entities. Isn't it? As I know the game also usning this method to determinate knife attack.

My goal is to detect player's and their body part.

Any useful information?

Edit: Solved. You have to use DONT_IGNORE_MONSTERS instead of IGNORE_MONSTERS. Players are monsters.


All times are GMT -4. The time now is 14:11.

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