Raised This Month: $ Target: $400
 0% 

Find sphere class help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Specialist
BANNED
Join Date: Nov 2006
Old 11-16-2006 , 23:55   Find sphere class help
Reply With Quote #1

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

Last edited by The Specialist; 11-17-2006 at 03:06.
The Specialist is offline
Send a message via AIM to The Specialist
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 11-17-2006 , 01:56   Re: Entity Get Vector
Reply With Quote #2

Code:
new Float:origin[3]; entity_get_vector(entity,EV_VEC_origin,origin);

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?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 02:01   Re: Entity Get Vector
Reply With Quote #3

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.

Last edited by The Specialist; 11-17-2006 at 03:08.
The Specialist is offline
Send a message via AIM to The Specialist
VEN
Veteran Member
Join Date: Jan 2005
Old 11-17-2006 , 03:13   Re: Find sphere class help
Reply With Quote #4

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.

Last edited by VEN; 11-17-2006 at 03:15.
VEN is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 03:16   Re: Find sphere class help
Reply With Quote #5

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
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-17-2006 , 03:44   Re: Find sphere class help
Reply With Quote #6

you mean to find a way that all the time check if they are out of the radious?
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 03:53   Re: Find sphere class help
Reply With Quote #7

yes basicly.
The Specialist is offline
Send a message via AIM to The Specialist
VEN
Veteran Member
Join Date: Jan 2005
Old 11-17-2006 , 03:54   Re: Find sphere class help
Reply With Quote #8

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].

Last edited by VEN; 11-17-2006 at 03:57.
VEN is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 03:59   Re: Find sphere class help
Reply With Quote #9

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.

Last edited by The Specialist; 11-17-2006 at 04:05.
The Specialist is offline
Send a message via AIM to The Specialist
VEN
Veteran Member
Join Date: Jan 2005
Old 11-17-2006 , 05:22   Re: Find sphere class help
Reply With Quote #10

You can do
PHP Code:
entlist_entnum find_sphere_class(bomb_entid"player"float_radiusint_array_entlistint_maxents_of_entlist
Then get all alive players and exclude ones that in the entlist array.
By this way you'll get all alive player indexes whose outside the given sphere.

Also you can do
PHP Code:
// loop through all alive players
if (entity_range(bombplayer) > radius// you're looking for this player(s) 

Last edited by VEN; 11-17-2006 at 05:29.
VEN is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:52.


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