[HELP] Finding Players Around Point
I'm looking for a way of finding players around a point where a shot has landed, much like the find_sphere_class function. However, that function uses an entity instead of coordinates, which I plan to get from Ham_TraceAttack.
Anyone know a way? Been searching for 2 days now but all I get are normal get_players functions, nothing relevant... |
Re: [HELP] Finding Players Around Point
|
Re: [HELP] Finding Players Around Point
You could try hooking FM_TraceLine with get_tr2 and retrieving the end vector (TR_vecEndPos), and then checking in the radius of the float that you stored the result of get_tr2.
|
Re: [HELP] Finding Players Around Point
Quote:
|
Re: [HELP] Finding Players Around Point
Quote:
|
Re: [HELP] Finding Players Around Point
Hook Ham_TraceAttack, get the TR_vecEndPos and use the following code to search for players within a radius.
PHP Code:
|
Re: [HELP] Finding Players Around Point
Quote:
|
Re: [HELP] Finding Players Around Point
Quote:
And yes, get_user_origin() wint mode = 4 will return the position (origin) of last bullet hit. |
Re: [HELP] Finding Players Around Point
find_ent_by_sphere loop through all entities in the game and mine only through players. Not a big deal but it takes less process.
|
Re: [HELP] Finding Players Around Point
Take a look at this. It's not entirely what you're doing, but maybe you can take something from it.
https://forums.alliedmods.net/showthread.php?t=318524 |
All times are GMT -4. The time now is 06:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.