Raised This Month: $ Target: $400
 0% 

Correct safety remove entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 10-02-2023 , 01:19   Re: Correct safety remove
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
it's not necessary for safety, it's just a flag that tell the engine the entity must be removed in the next frame

i see you are using remove_entity(ent) so i'm sure you are using engine module, just use remove_entity and set the entity next think in order to remove it from the world.
PHP Code:
public remove_all_bh(id)
{
    new 
ent 33;
    
    while((
ent find_ent_by_class(entgBlackHoleModel)) != 0) {
        if( 
entity_get_edict(entEV_ENT_owner) != id )
            continue;
            
        
set_pev(entpev_flagsFL_KILLME)
        
remove_entity(ent);
    }

-->

PHP Code:
public remove_all_bh(id)
{
    new 
ent 33;
    
    while((
ent find_ent_by_class(entgBlackHoleModel)) != 0) {
        if( 
entity_get_edict(entEV_ENT_owner) != id )
            continue;
            

        
set_pev(entpev_nextthinkget_gametime() + 0.1);
    }

something like this?
Arje is offline
 



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 07:37.


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