AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Removing entities (https://forums.alliedmods.net/showthread.php?t=195274)

vitorrossi 09-05-2012 14:29

Removing entities
 
Is this the proper way?

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_forward( FM_Spawn, "Spawn" );

public
plugin_init( )
 
unregister_forward( FM_Spawn, g_iSpawn );

public
Spawn( E )
{
    if(
pev_valid( E ) )
    {
        static
C[ 32 ], I;
       
pev( E, pev_classname, C, 32 );

        for(
I = 0; I < sizeof( cMyEntities ); I++ ) {
          if(
equal( cMyEntities[ I ], C ) ) {
             
engfunc( EngFunc_RemoveEntity, E ); break; }
        }
    }


claudiuhks 09-06-2012 05:09

Re: Removing entities
 
No!

PHP Code:

new const cMyEntities[ ] = 

Should be

PHP Code:

new const cMyEntities[ ][ ] = 



All times are GMT -4. The time now is 02:36.

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