Raised This Month: $ Target: $400
 0% 

Cancel defuse event?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 09:19   Re: Cancel defuse event?
Reply With Quote #4

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

const m_bIsC4             385
const m_bStartDefuse      384
const m_pBombDefuser      388
const m_fNextDefuse       107
const m_flDefuseCountDown 99

#if AMXX_VERSION_NUM < 183
    
const INT_BYTES 
    
const BYTE_BITS 

    stock bool
:get_pdata_bool(entcharbased_offsetintbase_linuxdiff 5
    { 
        return !!(
get_pdata_int(entcharbased_offset INT_BYTESintbase_linuxdiff) & (0xFF<<((charbased_offset INT_BYTES) * BYTE_BITS))) 
    } 
#endif

public plugin_init()
{
    
RegisterHam(Ham_Think"grenade""CGrenade_Think"false)
}

public 
CGrenade_Think(const GrenadeEntity)
{
    if(
pev_valid(GrenadeEntity) && get_pdata_bool(GrenadeEntitym_bIsC4))
    {
        if(
get_pdata_bool(GrenadeEntitym_bStartDefuse))
        {
            new 
DefuserIndex get_pdata_ent(GrenadeEntitym_pBombDefuser)
            if(
is_user_connected(DefuserIndex))
            {
                new 
Float:GameTime get_gametime()
                if(
GameTime get_pdata_float(GrenadeEntitym_flDefuseCountDown))
                {
                    new 
OnGround pev(DefuserIndexpev_flags) & FL_ONGROUND
                    
if(GameTime >  get_pdata_float(GrenadeEntitym_fNextDefuse) || !OnGrounde)
                    {
                        
client_print(0print_chat"%d stopped defusing"DefuserIndex)
                                                
//add your code here
                    
}
                }
            }
        }
    }

__________________

Last edited by HamletEagle; 07-17-2018 at 09:20.
HamletEagle 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 12:14.


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