Find sphere class help
I need help with using entity_get_vector() and find_sphere_class(). I want to get the origon of an entity by using the entity get vector , then pass that origon to the find_sphere_class. But im getting all sorts of errors with the paramters im passing. I already went and read documentation and Hawks tutorial on entities. But I cant seem to make this work. Can someone show me the proper way to do what im asking? Thanks guys :cry:
|
Re: Entity Get Vector
Code:
Notice that you have to create origin as a float and as a three-dimensional array. Is that what you were having trouble with, or was it more specifically find_sphere_class? |
Re: Entity Get Vector
i figured out that part . but i think i used origin wrong becasue im getting a tag mismatch warning. also i have a question about the find_sphere_cllass. Is it possable to get the id's or index's returned by the find_sphere_class ? I want to find all players out of radious and execute a function on them. find_sphere_class only returns the number of entitys found right ? i need the ids or indexes of the returned.
|
Re: Find sphere class help
num_of_ents_in_entlist = find_sphere_class(0, "player", Float_radius, int_array_entlist, integer_maxents_of_entlist, Float_3Darray_origin)
You specify radius, maxents and origin. |
Re: Find sphere class help
yes i have that part already. but what i need is a way to execute a function on every player that i DONT find in that radious. so any players out side of the radious have code executed on them . any ideas ? thanks again :wink:
|
Re: Find sphere class help
you mean to find a way that all the time check if they are out of the radious?
|
Re: Find sphere class help
yes basicly. :wink:
|
Re: Find sphere class help
Actually i'd not use find_sphere_class for that at all.
You always could do it without engine using for example get_players with "a" flag (if you want to check only alive players) and check the distance to the given origin with for example get_user_origin and get_distance[_f]. |
Re: Find sphere class help
hmmm briliant ! lol. ill have to do that instead. would it be more efficaint then trying to run it through the engine with a set ttask?
EDIT : actually , i dont think i can becasue i need to be able to get get the diistance from the bomb to players. and i belive i need the find_ent_by_class for that. :cry: |
Re: Find sphere class help
You can do
PHP Code:
By this way you'll get all alive player indexes whose outside the given sphere. Also you can do PHP Code:
|
| All times are GMT -4. The time now is 06:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.