Raised This Month: $ Target: $400
 0% 

Delay between buttons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 08-15-2013 , 14:34   Re: Delay between buttons
Reply With Quote #1

This should work ......

EDIT: TESTED....

PHP Code:

#include < amxmodx >
#include < fakemeta > 
#include < hamsandwich > 

new Float:fBug33 ]; 

public 
plugin_init() 
{
    
register_plugin"Button Delay""1.0""R0CK" );
    
    if( 
engfunc(EngFunc_FindEntityByString, -1"classname""func_button") )
    {
        
RegisterHamHam_Use"func_button""FwdTraceButtonUse" );
        
RegisterHamHam_TraceAttack"func_button""FwdTraceButtonAttack" ); 
    }
    
    if( 
engfunc(EngFunc_FindEntityByString, -1"classname""func_rot_button") )
    {
        
RegisterHamHam_Use"func_rot_button""FwdTraceButtonUse" );
        
RegisterHamHam_TraceAttack"func_rot_button""FwdTraceButtonAttack" ); 
    }
    
    if( 
engfunc(EngFunc_FindEntityByString, -1"classname""button_target") )
    {
        
RegisterHamHam_Use"button_target""FwdTraceButtonUse" );
        
RegisterHamHam_TraceAttack"button_target""FwdTraceButtonAttack" ); 
    }
}

public 
client_putinserverclient 

    
fBugclient ] = 0.0
}

public 
FwdTraceButtonAttackbuttonid )
    if( 
pev_validbutton ) && is_user_aliveid ) )
        
ExecuteHamBHam_Usebuttonidid21.0 );

public 
FwdTraceButtonUse(thisidcalleridactivatoruse_typeFloat:value)

    if( !
is_user_alive(idcaller) || idcaller != idactivator )
        return 
HAM_IGNORED;
        
    if( 
fBugidcaller ] + 1.5 >= get_gametime() ) 
    {
        
client_printidcallerprint_center"You need to wait at least 1.5 Seconds between using buttons." ); 
         
        return 
HAM_SUPERCEDE
    }
    
    
fBugidcaller ] = get_gametime(); 
    
    return 
HAM_IGNORED

__________________
Preparing to release my plugins..

Last edited by r0ck; 08-15-2013 at 15:52. Reason: tested
r0ck 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 15:48.


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