Raised This Month: $ Target: $400
 0% 

Timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-11-2014 , 08:46   Re: Timer
Reply With Quote #1

Without objectives.

Last edited by Monster Truck; 01-11-2014 at 08:47.
Monster Truck is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2014 , 05:35   Re: Timer
Reply With Quote #2

So other should have helped you...

You can use this :

PHP Code:
#include < amxmodx >

#if AMXX_VERSION_NUM < 183
    #include < engine >
    #define has_map_ent_class(%0)    find_ent_by_class(-1, %0)
#endif

#pragma semicolon 1

#define PLUGIN "No Objectives Time Out Message"
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

const TASK_ROUNDEND 1931543;

new 
mp_roundtimeFloat:g_flRoundTime;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    if(    !
has_map_objectives() )
    {
        
mp_roundtime get_cvar_pointer("mp_roundtime");
        
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
        
register_logevent("LogEvent_Round_Start"2"1=Round_Start");
        
register_logevent("Event_Round_End"2"1=Round_End");
        
Event_HLTV_New_Round();
    }
}

public 
Event_HLTV_New_Round()
{
    
remove_task(TASK_ROUNDEND);
    
g_flRoundTime floatclamp(get_pcvar_float(mp_roundtime)*60.060.0540.0);
}

public 
LogEvent_Round_Start()
{
    
set_task(g_flRoundTime"Task_RoundEnd"TASK_ROUNDEND);
}

public 
Event_Round_End()
{
    
remove_task(TASK_ROUNDEND);
}

public 
Task_RoundEnd()
{
    
// print your messages here
}

has_map_objectives()
{
    return ( 
has_map_ent_class("func_bomb_target") || has_map_ent_class("info_bomb_target") || has_map_ent_class("func_hostage_rescue")
            ||    
has_map_ent_class("func_escapezone") || has_map_ent_class("func_vip_safetyzone") || has_map_ent_class("hostage_entity")    );

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-12-2014 , 06:25   Re: Timer
Reply With Quote #3

Works great, thank you, and i can normally add the sound ?
Monster Truck is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-13-2014 , 00:54   Re: Timer
Reply With Quote #4

You can do normally what you can normally do ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-13-2014 , 02:15   Re: Timer
Reply With Quote #5

It works really fine, thank you again ;)
Monster Truck is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-25-2014 , 05:09   Re: Timer
Reply With Quote #6

Can anyone rebuild this sma for objective maps (i need it for vip escort) ? Thanks in advance for any answer
Monster Truck is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-25-2014 , 06:51   Re: Timer
Reply With Quote #7

Try :

PHP Code:
#include < amxmodx >

#if AMXX_VERSION_NUM < 183
    #include < engine >
    #define has_map_ent_class(%0)    find_ent_by_class(-1, %0)
#endif

#pragma semicolon 1

#define PLUGIN "No Objectives Time Out Message"
#define VERSION "0.0.2"

#define cm(%0)    ( sizeof(%0) - 1 )

const TASK_ROUNDEND 1931543;

new 
mp_roundtimeFloat:g_flRoundTime;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    if(    !
has_map_objectives() )
    {
        
mp_roundtime get_cvar_pointer("mp_roundtime");
        
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
        
register_logevent("LogEvent_Round_Start"2"1=Round_Start");
        
Event_HLTV_New_Round();
        
state NoObjectives;
    }
    else
    {
        
state Objectives;
    }
    
register_logevent("Event_Round_End"2"1=Round_End");
}

public 
Event_HLTV_New_Round()
{
    
remove_task(TASK_ROUNDEND);
    
g_flRoundTime floatclamp(get_pcvar_float(mp_roundtime)*60.060.0540.0);
}

public 
LogEvent_Round_Start()
{
    
set_task(g_flRoundTime"Task_RoundEnd"TASK_ROUNDEND);
}

public 
Event_Round_End() <Objectives>
{
    
Task_RoundEnd();
}

public 
Event_Round_End() <NoObjectives>
{
    
remove_task(TASK_ROUNDEND);
}

public 
Task_RoundEnd()
{
    
// print your messages here
}

has_map_objectives()
{
    return ( 
has_map_ent_class("func_bomb_target") || has_map_ent_class("info_bomb_target") || has_map_ent_class("func_hostage_rescue")
            ||    
has_map_ent_class("func_escapezone") || has_map_ent_class("func_vip_safetyzone") || has_map_ent_class("hostage_entity")    );

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-25-2014 at 06:51.
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 10:11.


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