[SOLVED] find_ent_by_owner() on client_disconnect()
Hi,
I got a problem when remove entity created by owner when owner disconnect from server. You can see an example code that i used in server. I got this error log: Code:
L 07/27/2011 - 17:17:46: [ENGINE] Invalid player 12 (not in-game)PHP Code:
|
Re: [Help] find_ent_by_owner() on client_disconnect()
If you are getting that error, then you will have to manually check for ownership using the find_ent_by_class() and entity_get_edict(..., EV_INT_owner).
|
Re: [Help] find_ent_by_owner() on client_disconnect()
Quote:
***Edited*** I've looking in OT's nademode code and found how the way he remove owner's entity it look like this: PHP Code:
|
Re: [Help] find_ent_by_owner() on client_disconnect()
Code:
|
Re: [Help] find_ent_by_owner() on client_disconnect()
Hmm, wouldn't this:
Code:
while(ent > 0)Anyway... you should use ent instead of -1 there and asign ent to -1 when you create it... but I'm gonna add the owner check aswell: Code:
new ent = -1 |
Re: [Help] find_ent_by_owner() on client_disconnect()
Quote:
|
Re: [Help] find_ent_by_owner() on client_disconnect()
Quote:
Still, it would be faster to input the entity back to the function to limit the search range... just pointing it out. EDIT: Also, AFAIK, it would also be useless to check for valid entity since that function only returns valid entities... reference to yokomo's last edit. |
Re: [Help] find_ent_by_owner() on client_disconnect()
Ok after 2 hours in server using this code:
PHP Code:
|
Re: [Help] find_ent_by_owner() on client_disconnect()
You could try to hook FM_ClientDisconnect PRE and then send find_ent_by_owner, but if you need only a specific classname, then the code you actually have is ok.
|
| All times are GMT -4. The time now is 01:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.