Raised This Month: $ Target: $400
 0% 

Removing entity if i know only origin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-25-2006 , 10:11   Removing entity if i know only origin?
Reply With Quote #1

How can i remove an entity, if i only know its origin? (It has no targetname >.> )
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-25-2006 , 11:06  
Reply With Quote #2

Try:
Code:
remove_entity(find_ent_in_sphere(-1, origin, 0.0))
VEN is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-25-2006 , 11:12  
Reply With Quote #3

OMFG, v3n, YOU SAVED ME AGAIN! ;P
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-25-2006 , 11:22  
Reply With Quote #4

Quote:
v3n
erm... np...
VEN is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-25-2006 , 11:46  
Reply With Quote #5

VEN, one problem, didnt work <.<
I made it like:
Code:
new Float:barorigin[3] = { -339.0, -835.0, -47 }
Code:
public remove_Bar() {      remove_entity(find_ent_in_sphere(-1, barorigin, 0.0)) }
and it didnt work, but said tag mismatch of the new Float:barorigin thingy <.<
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-25-2006 , 12:34  
Reply With Quote #6

*Bump*
I tried moving the entity to XYZ=9999, but it didnt move the ambient_generic at all >_< Only other entities around it :S
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-25-2006 , 14:01  
Reply With Quote #7

Quote:
didnt work
What actually didn't work mine example or your code?
Quote:
said tag mismatch
Code:
new Float:barorigin[3] = { -339.0, -835.0, -47.0 }

Quote:
I tried moving the entity
Did you tried to do it with entity_set_origin? If not - try it.
VEN is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-25-2006 , 14:05  
Reply With Quote #8

Or, just do a looping search, and delete it when the origin of the entity matches what its origin is.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Timoses
Member
Join Date: Mar 2006
Location: Germany, NRW
Old 03-25-2006 , 14:11  
Reply With Quote #9

I just tried it with

public stop1()
{
remove_entity(find_ent_in_sphere(-1, barrave, 900.0))
}


Well, the windows and other stuff got removed, but not the sound.
ambient_generic
so obviously remove_entity won't remove that, is there a way to
remove an ambient_generic?
Timoses is offline
Send a message via ICQ to Timoses Send a message via MSN to Timoses
VEN
Veteran Member
Join Date: Jan 2005
Old 03-25-2006 , 14:27  
Reply With Quote #10

[edit]

Here is the proper way:

Method #1:
Code:
new ent, classname[32] while ((ent = find_ent_in_sphere(ent, ENTITY_FLOAT_ORIGIN_HERE, 0.0))) {     entity_get_string(ent, EV_SZ_classname, classname, 31)     if (equal(classname, "ambient_generic")) {         // your code here         break     } }

Method #2:
Code:
new ent while ((ent = find_ent_by_class(ent, "ambient_generic"))) {     new Float:origin[3]     entity_get_vector(ent, EV_VEC_origin, origin)     if (origin[0] == YOUR_ENTITY_FLOAT_ORIGIN[0] &&     origin[1] == YOUR_ENTITY_FLOAT_ORIGIN[1] &&     origin[2] == YOUR_ENTITY_FLOAT_ORIGIN[2]) {         // your code here         break     } }
VEN 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 16:45.


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