Raised This Month: $ Target: $400
 0% 

Remove dropped entities except C4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 12-10-2011 , 16:46   Remove dropped entities except C4
Reply With Quote #1

How to remove all dropped entities except Bomb ?

PHP Code:
RegisterHam(Ham_Spawn"weaponbox""WeaponSpawned"1);

public 
WeaponSpawned(iEntity)
{
    
set_pev(iEntitypev_flagsFL_KILLME);
    
dllfunc(DLLFunc_ThinkiEntity);
    return 
HAM_IGNORED;

reinert is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-10-2011 , 17:41   Re: Remove dropped entities except C4
Reply With Quote #2

Try checking
Code:
if (cs_get_weapon_id(iEntity) == CSW_C4)     return HAM_IGNORED;
__________________
hleV is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-10-2011 , 17:55   Re: Remove dropped entities except C4
Reply With Quote #3

Or check so that the entity's classname isn't c4's classname.
Erox902 is offline
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 12-10-2011 , 18:10   Re: Remove dropped entities except C4
Reply With Quote #4

or something like this
PHP Code:
public delEnt()
{
    new 
ent = -1
    
while( !(ent find_ent_by_class(ent"bomb")))
    {
        
engfunc(EngFunc_RemoveEntity,ent)
    }

neverminde is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-10-2011 , 20:47   Re: Remove dropped entities except C4
Reply With Quote #5

Quote:
Originally Posted by neverminde View Post
or something like this
PHP Code:
public delEnt()
{
    new 
ent = -1
    
while( !(ent find_ent_by_class(ent"bomb")))
    {
        
engfunc(EngFunc_RemoveEntity,ent)
    }

Wont this delete it even if someone is holding it?
Erox902 is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 12-11-2011 , 03:33   Re: Remove dropped entities except C4
Reply With Quote #6

Quote:
Originally Posted by Erox902 View Post
Wont this delete it even if someone is holding it?
It doesn't remove anything because afaik its not even real entity name. And even if it had proper entity name it wouldn't remove the bomb.

Quote:
Originally Posted by Erox902 View Post
Or check so that the entity's classname isn't c4's classname.
hleV's code should work like reiner wants.

Last edited by matsi; 12-11-2011 at 03:37.
matsi is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 12-11-2011 , 08:48   Re: Remove dropped entities except C4
Reply With Quote #7

Quote:
Originally Posted by hleV View Post
Try checking
Code:
if (cs_get_weapon_id(iEntity) == CSW_C4)     return HAM_IGNORED;
Does not work
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-11-2011 , 10:15   Re: Remove dropped entities except C4
Reply With Quote #8

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

#define VERSION "0.0.1"
#define PLUGIN "Remove Weapons"

#define XO_WEAPONBOX 4
new const m_rgpPlayerItems_wpnbx[] = {353638}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
RegisterHamHam_Touch"weaponbox""WeaponBox_Touch")
    
RegisterHamHam_Touch"weapon_shield""WeaponShield_Touch")
}

public 
WeaponBox_Touch(iEntiOther)
{
    for(new 
ii<3i++)
    {
        if( 
get_pdata_cbase(iEntm_rgpPlayerItems_wpnbx[i], XO_WEAPONBOX) > )
        {
            
call_thinkiEnt )
            return
        }
    }
}

public 
WeaponShield_Touch(iEntiOther)
{
    
call_thinkiEnt )

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 03:36.


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