Raised This Month: $ Target: $400
 0% 

[clarified] entities with owner delete themselves ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-15-2009 , 07:39   [clarified] entities with owner delete themselves ?
Reply With Quote #1

I get errors on disconnects that find_ent_by_owner() user's does not exist (doh, he just quit...) ... but, I want to know if entities that have owners delete themselves when the owner is gone ? if they don't I would make an alternative to find_ent_by_owner() to delete them...
__________________
Hunter-Digital is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 05-15-2009 , 11:21   Re: entities with owner delete themselves ?
Reply With Quote #2

Quote:
Originally Posted by Hunter-Digital View Post
... but, I want to know if entities that have owners delete themselves when the owner is gone ?
No, entities with owners will stay in the game.
hlstriker is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-15-2009 , 17:46   Re: entities with owner delete themselves ?
Reply With Quote #3

that sux, because upon disconnect I can't delete them easily using find_ent_by_owner(), I need to do a loop... anyway, It's possible so w/e
__________________
Hunter-Digital is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 05-15-2009 , 18:26   Re: entities with owner delete themselves ?
Reply With Quote #4

use pev_valid( owner )
__________________

padilha007 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-15-2009 , 18:50   Re: entities with owner delete themselves ?
Reply With Quote #5

Quote:
Originally Posted by padilha007 View Post
use pev_valid( owner )
But find_ent_by_owner doesn't work, that's the point here ;)


You could save ents in an dynamic array, i mean a 33 array, in each cell a dynamic array that holds owner ents, then you can retrieve them easily on disconnect. There should be a better way, but that was just a coming idea
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-16-2009 , 15:31   Re: entities with owner delete themselves ?
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
But find_ent_by_owner doesn't work, that's the point here ;)


You could save ents in an dynamic array, i mean a 33 array, in each cell a dynamic array that holds owner ents, then you can retrieve them easily on disconnect. There should be a better way, but that was just a coming idea
No, I just want to delete the ents when the owner disconnects... but I knew how it's done in the alternative way, I just wanted to know if it's required :}
PHP Code:
public client_disconnect(id)
{
     new 
ent = -1
 
     
while((ent find_ent_by_class(ent"ent_class")) != 0)
            if(
entity_get_edict(entEV_ENT_owner) == id)
                  
remove_entity(ent)
 
     
ent = -1
 
     
while((ent find_ent_by_class(ent"ent_class_two")) != 0)
            if(
entity_get_edict(entEV_ENT_owner) == id)
                  
remove_entity(ent)

end of topic
__________________
Hunter-Digital is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 05-15-2009 , 19:48   Re: entities with owner delete themselves ?
Reply With Quote #7

__________________

padilha007 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 01:30.


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