AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Proper removal of Monster Mod monsters on round end in CS or CZ (https://forums.alliedmods.net/showthread.php?t=105156)

vittu 10-01-2009 19:11

Proper removal of Monster Mod monsters on round end in CS or CZ
 
Just asking for advice on removal of Monster Mod monsters on round end in CS or CZ.


Here is what I'm thinking of using for removal:
Code:
    new monster = -1     while ( (monster = engfunc(EngFunc_FindEntityByString, monster, "classname", "func_wall")) != 0 ) {         if ( pev(monster, pev_flags) & FL_MONSTER ) {             engfunc(EngFunc_RemoveEntity, monster)         }     }


a. are all monsters func_wall?
b. do all monsters have FL_MONSTER flag? do other fun_wall's have this flag? I only want to remove Monster Mod monsters not other things.
c. anything wrong with just removing the monsters? like do i need to kill it by settings it's health to 0 instead, or set FL_KILLME flag or something?

joaquimandrade 10-01-2009 19:31

Re: Proper removal of Monster Mod monsters on round end in CS or CZ
 
PHP Code:

template <class TCreateClassPtr*)
{
    ...

    if ((
temp_edict a->CreateEntity("func_wall")) == NULL)
    {
    ... 

a - Yes

PHP Code:

void CMBaseMonster :: MonsterInit void )
{
    ...
    
SetBits (pev->flagsFL_MONSTER);
... 

b - Yes. If it is possible that other func_wall have it? Yes. If they have in fact? I don't think so. I don't know of other usages of func_wall except this and in mapping

c - I believe its ok.

vittu 10-02-2009 00:48

Re: Proper removal of Monster Mod monsters on round end in CS or CZ
 
Thanks joaquim,

I should have just checked the source myself, kinda slipped my mind to do that.


I decided to go with FL_KILLME rather than just removing the ents because it will show them die (setting health to 0 also had this effect, but I figured this would be better).
Code:
    new monster = -1     new flags     while ( (monster = engfunc(EngFunc_FindEntityByString, monster, "classname", "func_wall")) != 0 ) {         flags = pev(monster, pev_flags)         if ( flags & FL_MONSTER ) {             set_pev(monster, pev_flags, flags | FL_KILLME)         }     }

Also thinking round start on HLTV event might be better than round end.


All times are GMT -4. The time now is 22:43.

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