Raised This Month: $51 Target: $400
 12% 

The Best Way to Remove


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-20-2018 , 10:19   The Best Way to Remove
Reply With Quote #1

I want to remove some entities but I don't know the best way to remove.

Spoiler
PurposeLessx is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 06-20-2018 , 13:18   Re: The Best Way to Remove
Reply With Quote #2

Code:
public remove_entity()
{
    new ent = -1;

    while ((ent = find_ent_by_class(ent, "func_bomb_target")))
    {
	remove_entity(ent);
    }
}

Last edited by raizo11; 06-20-2018 at 13:24.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-20-2018 , 13:41   Re: The Best Way to Remove
Reply With Quote #3

Otherwise I find another method to remove. Is it any problem about my method?

PHP Code:

new const szRemoveEntities[][] =  {
    
"func_bomb_target""func_escapezone""func_hostage_rescue""func_vip_safetyzone""info_vip_start",
    
"hostage_entity""info_bomb_target""func_buyzone","info_hostage_rescue""monster_scientist",
    
"player_weaponstrip""game_player_equip"
}

public 
plugin_cfg()
{
    
TrieDestroy(g_tRemoveEntities);
    
unregister_forward(FM_Spawng_iForwardSpawn0);
}

public 
plugin_precache()
{
    
g_tRemoveEntities TrieCreate();
    for(new 
0sizeof(szRemoveEntities); i++)
    {
        
TrieSetCell(g_tRemoveEntitiesszRemoveEntities[i], i);
    }
    
g_iForwardSpawn register_forward(FM_Spawn"FM_Spawn_Pre"false);
    
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"func_buyzone"));
}

public 
FM_Spawn_Pre(ent)
{
    if(!
pev_valid(ent))
    {
        return 
1;
    }

    new 
classname[32];
    
get_entvar(entvar_classnameclassnamecharsmax(classname));

    if(
TrieKeyExists(g_tRemoveEntitiesclassname))
    {
        
engfunc(EngFunc_RemoveEntityent);
        return 
4;
    }
    return 
1;


Last edited by PurposeLessx; 06-20-2018 at 13:41.
PurposeLessx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-20-2018 , 14:34   Re: The Best Way to Remove
Reply With Quote #4

Raizo he didnt ask how he asked whats the best method to remove entity also your code wont compile.

@OP hook entity spawn then remove it.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply



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 15:00.


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