Raised This Month: $ Target: $400
 0% 

block round on defuse or explode bomb


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-13-2014 , 23:58   Re: block round on defuse or explode bomb
Reply With Quote #7

You can try this, not really efficient as forward gonna be called each time a grenade is thinking, but for obscur reasons you don't want to use orpheu, which would be an strongly efficient way.

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1

#define PLUGIN ""
#define VERSION "0.0.1"

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

// const XO_CGRENADE = 5;
const m_bStartDefuse 384;
const 
m_bIsC4 =    385;
const 
m_flDefuseCountDown 99;
const 
m_flC4Blow 100;
const 
m_pBombDefuser_pent 388;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    
RegisterHam(Ham_Think"grenade""OnCGrenade_C4Think");
}

public 
OnCGrenade_C4Thinkc4 )
{
    if( !
get_pdata_bool(c4m_bIsC4) )
    {
        return 
HAM_IGNORED;
    }

    new 
Float:flTime get_gametime();

    if( 
get_pdata_float(c4m_flC4Blow) <= flTime )
    {
        
set_pev(c4pev_flagsFL_KILLME);
        
        
// C4 should have blown here
        // Execute the code you want

        
        
return HAM_SUPERCEDE;
    }

    if( 
get_pdata_bool(c4m_bStartDefuse) )
    {
        new 
iDefuser get_pdata_ent(c4m_pBombDefuser_pent);
        if( 
iDefuser && get_pdata_float(c4m_flDefuseCountDown) <= flTime )
        {
            
set_pev(c4pev_flagsFL_KILLME);
            
ExecuteHamB(Ham_CS_Player_ResetMaxSpeediDefuser);
        
            
// C4 should have been defused here
            // Execute the code you want


            
return HAM_SUPERCEDE;
        }
    }

    return 
HAM_IGNORED;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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:13.


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