find_ent_in_sphere problem
hello,
i'm searching a piece of code that returns an array of player indexes in a certain radius around a player i know find_ent_in_sphere should be capable of doing that, but can anyone give me an example ? the player "id" is the start entity, so the search should start around him and it would have to return an array of players in a radius of 100 or should i use a traceline around the player's body to find the closest player-entity? |
Re: find_ent_in_sphere problem
Something like this?:
Code:
public test(id){ |
Re: find_ent_in_sphere problem
Quote:
|
Re: find_ent_in_sphere problem
hehe right, too quick with posting
You can also use this: Code:
|
Re: find_ent_in_sphere problem
Quote:
|
Re: find_ent_in_sphere problem
Here without origin,but it need engine module
This set every player who is in radius in the array to 1,and the rest to 0 Code:
or with "get_entity_distance(ent1, ent2)" that return a non float value,but is the same. |
Re: find_ent_in_sphere problem
and what i have to change if they have to be on the left or right side from me ?
so practically close to the same x axis |
Re: find_ent_in_sphere problem
for this you need the player origin
Code:
|
Re: find_ent_in_sphere problem
I don't think that'll work, since the origin[0] always changes.
|
Re: find_ent_in_sphere problem
Quote:
with get_user_origin(id,OriginA) it get own origin. with get_user_origin(i,OriginB) it get the playerorigin And the example was only for 1 time for 1 second,its not the fully plugin. |
| All times are GMT -4. The time now is 06:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.