Raised This Month: $32 Target: $400
 8% 

about removing entity.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jacob
Senior Member
Join Date: Oct 2010
Old 07-18-2011 , 21:18   about removing entity.
Reply With Quote #1

when an entity has been created

PHP Code:
new ent_a create_entity("info_target"
how to remove this entity(ent_a) automatically after a certain time(e.g 20 seconds).
thx!
Jacob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-18-2011 , 21:37   Re: about removing entity.
Reply With Quote #2

Code:
set_task(20.0, "TaskRemoveEntity", ent_a) // .. public TaskRemoveEntity(ent) {     if(is_valid_ent(ent))     {         remove_entity(ent)     } }
or
Code:
entity_set_int(ent_a, EV_INT_flags, (get_entity_flags(ent_a) | FL_KILLME)) entity_set_float(ent_a, EV_FL_nextthink, (get_gametime() + 20.0))
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 07-18-2011 , 23:33   Re: about removing entity.
Reply With Quote #3

thank you Exolent. i have tested the method 1 before,it caused the server to shut down.

Last edited by Jacob; 07-19-2011 at 04:11.
Jacob is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-19-2011 , 06:12   Re: about removing entity.
Reply With Quote #4

Method 1 didn't work? What error did it give you? Method 1 is as simple as it gets.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 07-19-2011 , 20:08   Re: about removing entity.
Reply With Quote #5

Quote:
Originally Posted by Tirant View Post
Method 1 didn't work? What error did it give you? Method 1 is as simple as it gets.
i tested the method1 many times, it caused my server to shut down.
Jacob is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-19-2011 , 20:40   Re: about removing entity.
Reply With Quote #6

Post your code here.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Jacob
Senior Member
Join Date: Oct 2010
Old 07-19-2011 , 21:57   Re: about removing entity.
Reply With Quote #7

Quote:
Originally Posted by wrecked_ View Post
Post your code here.
solved. Exolent's second method is ok.
plugin is "Healthkit on dead body" by tuty.
Jacob is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-19-2011 , 23:17   Re: about removing entity.
Reply With Quote #8

There is no reason why the first method shouldn't work, unless there is some problem with the task.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant 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 00:22.


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