Raised This Month: $51 Target: $400
 12% 

Cancel defuse event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sekac
Senior Member
Join Date: Nov 2016
Old 07-16-2018 , 11:44   Cancel defuse event?
Reply With Quote #1

I tried this: register_event("BarTime", "event_function", "b", "1=0"), but it's only triggered when you stop planting the bomb.
sekac is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-16-2018 , 13:17   Re: Cancel defuse event?
Reply With Quote #2

You want to cancel defuse or hook when that happens?
__________________
HamletEagle is offline
sekac
Senior Member
Join Date: Nov 2016
Old 07-17-2018 , 05:22   Re: Cancel defuse event?
Reply With Quote #3

Hook when it happens.
sekac is offline
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
sekac
Senior Member
Join Date: Nov 2016
Old 07-17-2018 , 09:42   Re: Cancel defuse event?
Reply With Quote #5

Thank you!
sekac is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-17-2018 , 10:13   Re: Cancel defuse event?
Reply With Quote #6

Ham can you demonstrate how the stock get_pdata_bool with numbers.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2018 , 10:17   Re: Cancel defuse event?
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
Ham can you demonstrate how the stock get_pdata_bool with numbers.
What do you mean?
__________________
HamletEagle 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 01:34.


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