Raised This Month: $ Target: $400
 0% 

Removing map entitys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Enomine
Junior Member
Join Date: Apr 2012
Old 05-03-2012 , 05:48   Removing map entitys
Reply With Quote #1

I don't know what is the problem, but doesn't work :\

Code:
//Global new const MapEntitys[] = {     "func_bomb_target",     "info_bomb_target",     "hostage_entity",     "monster_scientist",     "func_hostage_rescue",     "info_hostage_rescue",     "info_vip_start",     "func_vip_safetyzone",     "func_escapezone",     "armoury_entity",     "game_player_equip",     "player_weaponstrip" }; //Init     register_forward(FM_Spawn, "fwdSpawn"); public fwdSpawn(Ent) {     if(pev_valid(Ent))     {         set_task(0.1,"cmdRemoveEnt",Ent+TASK_ENTITYS);         return FMRES_HANDLED;     }         return FMRES_IGNORED; } //-----------------------------// public cmdRemoveEnt(Ent) {     Ent -= TASK_ENTITYS;         if(!pev_valid(Ent))         return PLUGIN_HANDLED;             new EntClass[32];     entity_get_string(Ent, EV_SZ_classname, EntClass, charsmax(EntClass));         for(new i = 0;i < charsmax(MapEntitys);i++)     {         if(equali(EntClass, MapEntitys[i]))         {             engfunc(EngFunc_RemoveEntity, Ent);             break;         }     }         return PLUGIN_HANDLED; }

Last edited by Enomine; 05-03-2012 at 06:16.
Enomine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-04-2012 , 09:25   Re: Removing map entitys
Reply With Quote #2

PHP Code:
new const cMyEntities[ ] =
{
    
"func_bomb_target",
    
"info_bomb_target",
    
"hostage_entity",
    
"monster_scientist",
    
"func_hostage_rescue",
    
"info_hostage_rescue",
    
"info_vip_start",
    
"func_vip_safetyzone",
    
"func_escapezone",
    
"armoury_entity",
    
"game_player_equip",
    
"player_weaponstrip"
}; new g_iSpawn;

public 
plugin_precache( )
  
g_iSpawn register_forwardFM_Spawn"Spawn" );

public 
plugin_init( )
  
unregister_forwardFM_Spawng_iSpawn );

public 
Spawn)
{
    if( 
pev_valid) )
    {
        static 
C32 ], I;
        
pevEpev_classnameC32 );

        for( 
0sizeofcMyEntities ); I++ ) {
          if( 
equalcMyEntities], ) ) {
              
engfuncEngFunc_RemoveEntity); break; }
        }
    }

__________________

Last edited by claudiuhks; 05-04-2012 at 09:27.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 00:27.


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