Raised This Month: $ Target: $400
 0% 

Remove ent from location x


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 05-07-2007 , 16:45   Remove ent from location x
Reply With Quote #1

How can i remove ent like (func_door) in certain location like coordinates? And same with trigger_hurt.
[X]-RayCat is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-07-2007 , 18:04   Re: Remove ent from location x
Reply With Quote #2

You can try this..
Maybe someone knows a better way..possibly only with fakemeta!?

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

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


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

public remove_ent()
{
    new Float:CertainOrigin[3];
    new ent;
    while((ent = find_ent_in_sphere(ent, CertainOrigin, 100.0)) != 0)
    {
        if(!pev_valid(ent)) return;
        static classname[32];
        pev(ent, pev_classname, classname, sizeof classname - 1);
        if(equal(classname, "func_door")) engfunc(EngFunc_RemoveEntity, ent);
        if(equal(classname, "trigger_hurt")) engfunc(EngFunc_RemoveEntity, ent);
    }
}
greetz regalis
__________________

Last edited by regalis; 05-07-2007 at 20:44. Reason: changed a little
regalis is offline
Old 05-08-2007, 16:32
[X]-RayCat
This message has been deleted by [X]-RayCat.
Drak
Veteran Member
Join Date: Jul 2005
Old 05-08-2007 , 16:35   Re: Remove ent from location x
Reply With Quote #3

Whatever is the "CertinOrigin" is the X, Y, Z coordinates.

Quote:
Originally Posted by [X]-RayCat View Post
Where should i put coordinades im pretty confused.
Also i ment how i set trigger_hurt to certain location. Weird Weiird idk.

You asked, how to remove the entitys. Not make/edit them.
But, just find the "trigger_hurt" and set it's origin..
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 05-08-2007 , 16:37   Re: Remove ent from location x
Reply With Quote #4

What is your certain location related to? Is it near you? Near the place you're pointing at? Or are you taking it from a file, so it's exact? Don't you need to remove all the doors from your map?
alien is offline
Send a message via ICQ to alien
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 #5

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
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 06:36.


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