Raised This Month: $ Target: $400
 0% 

remove objectives..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-21-2010 , 04:47   remove objectives..
Reply With Quote #1

i have 1 problem with this plugin. it does not end the round if the time has ended.. how to make it end round if the time is finish ?

PHP Code:
#define CVAR_DEFAULT OBJTYPE_ALL

#define OBJTYPE_AS ( 1<<0 )
#define OBJTYPE_CS ( 1<<2 )
#define OBJTYPE_DE ( 1<<3 )
#define OBJTYPE_ES ( 1<<4 )
#define OBJTYPE_ALL ( OBJTYPE_AS | OBJTYPE_CS | OBJTYPE_DE | OBJTYPE_ES )

#define CVAR_NAME "No_Objectives"

new const g_Objective_Ents[ ][ ] = 
{
    
"func_bomb_target",
    
"info_bomb_target",
    
"hostage_entity",
    
"monster_scientist",
    
"func_hostage_rescue",
    
"info_hostage_rescue",
    
"info_vip_start",
    
"func_vip_safetyzone",
    
"func_escapezone"
}

new const 
g_Objective_Type[ ] = 
{
    
OBJTYPE_DE,
    
OBJTYPE_DE,
    
OBJTYPE_CS,
    
OBJTYPE_CS,
    
OBJTYPE_CS,
    
OBJTYPE_CS,
    
OBJTYPE_AS,
    
OBJTYPE_AS,
    
OBJTYPE_ES
}

new const 
bool:g_Objective_Prim[ ] =
{
    
true,
    
true,
    
true,
    
false,
    
false,
    
false,
    
false,
    
true,
    
true
}

new 
g_Pcvar_No_Objectives
new g_No_Objectives CVAR_DEFAULT OBJTYPE_ALL


public plugin_init( ) 
{    
    if ( !
g_Pcvar_No_Objectives 
    {
        new 
cvar_defval]
        
get_flagsCVAR_DEFAULTcvar_defvalsizeof cvar_defval )
        
register_cvarCVAR_NAMEcvar_defval )
    }

    if ( 
Is_Objective_Map( ) )
            return
}

public 
plugin_precache( )
{
    if ( ( 
g_Pcvar_No_Objectives get_cvar_pointerCVAR_NAME ) ) ) 
    {
        new 
cvar_val]
        
get_pcvar_stringg_Pcvar_No_Objectivescvar_valsizeof cvar_val )
        
g_No_Objectives read_flagscvar_val ) & OBJTYPE_ALL
    
}

    if ( 
g_No_Objectives )
    {
        
register_forwardFM_Spawn"forward_spawn" 
    }
}

public 
forward_spawnent 
{
    if ( !
pev_valident ) )
            return 
FMRES_IGNORED

    
static classname32 ], i
    pev
entpev_classnameclassnamesizeof classname )

    for ( 
0sizeof g_Objective_Ents; ++
    {
        if ( 
equalclassnameg_Objective_Ents] ) ) 
        {
            if ( !( 
g_No_Objectives g_Objective_Type] ) )
                    return 
FMRES_IGNORED

        engfunc
EngFunc_RemoveEntityent 
        return 
FMRES_SUPERCEDE
    
}
    }
    return 
FMRES_IGNORED
}

bool:Is_Objective_Map( ) 
{
    new const 
classname[ ] = "classname"
    
for ( new 0sizeof g_Objective_Ents; ++)
    {
        if ( 
g_Objective_Prim] && engfuncEngFunc_FindEntityByStringFM_NULLENTclassnameg_Objective_Ents] ) )
            return 
true
    
}
    return 
false

zombieplague is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-21-2010 , 08:46   Re: remove objectives..
Reply With Quote #2

I suggest to register FM_Spawn as POST and don't supercede. Instead just remove desired entities in that call.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
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 07:13.


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