This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

find_ent_sphere and find_sphere_class help?!?!?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ronkkrop
Member
Join Date: May 2004
Old 10-28-2004 , 05:30   find_ent_sphere and find_sphere_class help?!?!?
Reply With Quote #1

Code:
new Float:fpOrigin[3]
	new pOrigin[3]
	get_user_origin(id, pOrigin)
	fpOrigin[0] = float(pOrigin[0])
	fpOrigin[1] = float(pOrigin[1])
	fpOrigin[2] = float(pOrigin[2])
	new iEnts[20]
	new iEntity = find_ent_in_sphere(-1, fpOrigin, 200.0)
	find_sphere_class(0, "info_player_deathmatch", 20.0, iEnts, 20, fpOrigin)
	server_print( "found something %f %f %f", fpOrigin[0],fpOrigin[1],fpOrigin[2] )
	//
look at that. this tidbit of code is used to try and find out how find_ent_in_sphere and find_sphere_class work. Im doing it based on player location, but i seem to get tag mismatch everywhere even when i convert it to a float, and when i run hlds, i get bad load. Anybody know anythign about this? I need to be able to find a spawn point based on the location of a player. So any help would be great, mmmmmkay

Thanks for the help in advance.


Edit: im aware that the server_print shows nothing but the player origin as converted floats.
__________________
"I refuse to join any club that would have me as a member."
--Groucho Marx
Ronkkrop is offline
Send a message via ICQ to Ronkkrop Send a message via AIM to Ronkkrop Send a message via MSN to Ronkkrop Send a message via Yahoo to Ronkkrop
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-28-2004 , 09:44  
Reply With Quote #2

Using only that code, I get 0 tag mismatches. The only warning I get is about an unused variable, but that isn't important. And as far as running it, I don't have any problems. Engine module enabled?
DS is offline
Ronkkrop
Member
Join Date: May 2004
Old 10-28-2004 , 13:33   ...
Reply With Quote #3

Yes it compiles like this, but it gets a bad load when you run hlds.

Edit: Yep, i did have engine module commented out, its been too long since i made amx scripts.
__________________
"I refuse to join any club that would have me as a member."
--Groucho Marx
Ronkkrop is offline
Send a message via ICQ to Ronkkrop Send a message via AIM to Ronkkrop Send a message via MSN to Ronkkrop Send a message via Yahoo to Ronkkrop
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 10-29-2004 , 11:14  
Reply With Quote #4

Not sure that using find_ent_sphere() or anything that uses that function is good. Nowadays I usually just use find_ent_by_class() anyway and then just check the distance from one point or entity to another point or entity, using entity_range() or vector_distance(). I think that should be faster in most cases.
Johnny got his gun is offline
Reply



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 12:25.


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