Raised This Month: $ Target: $400
 0% 

Remove ent from location x


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-08-2007 , 16:49   Re: Remove ent from location x
Reply With Quote #6

With that you can remove all defined ents from a map:

Code:
#include <amxmodx> 
#include <fakemeta>
#include <engine>

static const PLUGIN_NAME[]       = "Remove_Ents";
static const PLUGIN_AUTHOR[]     = "regalis";
static const PLUGIN_VERSION[]    = "1.0";

public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
    register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
    remove_door();
}

public remove_door()
{
    new ent;
    
    // Remove all rotating doors
    while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_door_rotating")) != 0)
    {
        if(!pev_valid(ent)) return FMRES_IGNORED;
        engfunc(EngFunc_RemoveEntity, ent);

    }
    
    // Remove all doors
    while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_door")) != 0)
    {
        if(!pev_valid(ent)) return FMRES_IGNORED;
        engfunc(EngFunc_RemoveEntity, ent);
    }
    
    // Remove all breakables
    while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "func_breakable")) != 0)
    {
        if(!pev_valid(ent)) return FMRES_IGNORED;
        engfunc(EngFunc_RemoveEntity, ent);
    }
    return FMRES_IGNORED;
}
__________________

Last edited by regalis; 05-12-2007 at 08:27. Reason: converted fully to fakemeta...
regalis 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 06:36.


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