View Single Post
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