AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Active blast on last 3 seconds (https://forums.alliedmods.net/showthread.php?t=229701)

wicho 11-12-2013 22:20

[HELP] Active blast on last 3 seconds
 
Hi everybody, well i use a plugin called round draw blast consist when the round finish this kill all the players, but i want to active on the last 3 seconds, how i can make this?.. thx in advance

This is the code:

PHP Code:

#include <amxmodx>

// Type slash (/) in front of this line for normal gameplay.....
#define ZOMBIE_MOD

/*================================================================================
 [Plugin Customization]
=================================================================================*/

// Notice shown to players before the blast
new const warning_notice[] = { "Warning! Umbrella has launched a nuke over the area..." }

// Sounds
new const sound_siren[] = { "ambience/siren.wav" }
new const 
sound_launch[] = { "weapons/mortar.wav" }
new const 
sound_blast[] = { "weapons/mortarhit.wav" }

/*============================================================================*/

const BLAST_TASK 5000
const LOOP_TASK 100
const TASK_ID 652450;
new 
g_msgScreenFadeg_msgDeathMsg,g_maxplayers,c_frezeeblah false;

// ??? Misterious variables ???
new Float:get_round_time,g_pCvarRoundTime ;
// ??? Misterious variables ???

public plugin_precache()
{
    
precache_sound(sound_siren)
    
precache_sound(sound_launch)
    
precache_sound(sound_blast)
}

public 
plugin_init()
{
    
register_plugin("Round End Blast""2.0""Anggara_nothing + MeRcyLeZZ")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
#if defined ZOMBIE_MOD
        
register_logevent("logevent_round_end"2"1=Round_End" );
    
#else
        
register_event"TextMsg""logevent_round_end""a""2&#Round_Draw""2&#Target_Saved""2&#VIP_Escaped" );
    
#endif
    
    
c_frezee get_cvar_pointer("mp_freezetime")
    
g_pCvarRoundTime get_cvar_pointer("mp_roundtime")
    
    
g_msgScreenFade get_user_msgid("ScreenFade")
    
g_msgDeathMsg get_user_msgid("DeathMsg")
    
g_maxplayers get_maxplayers()
}

public 
event_round_start()
{
    
remove_task(TASK_ID)    // Bugfix
    
remove_task(BLAST_TASK// Bugfix
    
blah false
    set_task
(get_pcvar_float(c_frezee),"remove_noob_looptask")
    
client_cmd(0"stopsound")
}

public 
remove_noob_looptask()
{
    
blah true
    get_round_time 
floatmul(get_pcvar_float(g_pCvarRoundTime) , 60.0) - 10.0
    set_task
(get_round_time"nuclear_alarm"TASK_ID);
}

public 
nuclear_alarm()        
    
client_cmd(0"spk %s"sound_siren)

public 
logevent_round_end()
{
    
// No one won
    
if (AreBothTeamsAlive() == true
    {
        if(
blah
        {
            
// Remove previous tasks and set the new ones
            
remove_task(BLAST_TASK)
            
set_task(0.1"task_siren"BLAST_TASK)
        }
    }
}

public 
task_siren()
{
    
// Show notice
    
client_print(0print_chat"%s"warning_notice)
    
    
// Siren sound
    
client_cmd(0"spk %s"sound_siren)
    
    
set_task(0.7"task_launch"BLAST_TASK)
}

public 
task_launch()
{
    
// Launch sound
    
client_cmd(0"spk %s"sound_launch)
    
    
// Screen fade effect
    
message_begin(MSG_BROADCASTg_msgScreenFade)
    
write_short((1<<12)*4)    // Duration
    
write_short((1<<12)*1)    // Hold time
    
write_short(0x0001)    // Fade type
    
write_byte (255)    // Red
    
write_byte (255)    // Green
    
write_byte (255)    // Blue
    
write_byte (255)    // Alpha
    
message_end()
    
    
set_task(1.7"task_blast"BLAST_TASK)
}

public 
task_blast()
{
    
// Blast sound
    
client_cmd(0"spk %s"sound_blast)
    
    static 
iddeathmsg_block
    
    
// Get current blocking state of the deathmsg
    
deathmsg_block get_msg_block(g_msgDeathMsg)
    
    
// Set it to blocked
    
set_msg_block(g_msgDeathMsgBLOCK_SET)
    
    
// "Eliminate" players
    
for (id 1id <= g_maxplayersid++)
        if (
is_user_alive(id))
            
user_kill(id1)
    
    
// Set the previous blocking state
    
set_msg_block(g_msgDeathMsgdeathmsg_block)
}

// Get Alive CTs -returns number of CTs alive-
/*fnGetAliveCTs()
{
    static iCTs, id
    iCTs = 0
    
    for (id = 1; id <= g_maxplayers; id++)
    {
        if (is_user_alive(id))
        {            
            if (cs_get_user_team(id) == CS_TEAM_CT)
                iCTs++
        }
    }
    
    return iCTs;
}

// Get Alive Ts -returns number of Ts alive-
fnGetAliveTs()
{
    static iTs, id
    iTs = 0
    
    for (id = 1; id <= g_maxplayers; id++)
    {
        if (is_user_alive(id))
        {            
            if (cs_get_user_team(id) == CS_TEAM_T)
                iTs++
        }
    }
    
    return iTs;
}*/
bool:AreBothTeamsAlive()
{    
    new 
iPlayers32 ], iNum;     
    
get_playersiPlayersiNum"a" );        
    new 
bool:bTbool:bCT;    
    for( new 
0iNumi++ )
    {         
        switch( 
get_user_teamiPlayers] ) )
        {            
            case 
1: {    // Terrorist
                
if( bCT )
                    return 
true;
                
bT true;             
            }             
            case 
2: {    // Counter-Terrorist
                
if( bT )
                    return 
true;
                
bCT true;             
            }         
        }
    }         
    return 
false




All times are GMT -4. The time now is 23:16.

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