Raised This Month: $ Target: $400
 0% 

change attack delay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nyuszy
Senior Member
Join Date: Apr 2009
Old 03-29-2011 , 11:56   change attack delay
Reply With Quote #1

how can i change the delay time between two attacks?
for ex. i fire my awp, and i want to set the delay to 30 sec, so i can fire the weapon again when that 30 sec i passed...

sorry for my english
Nyuszy is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-29-2011 , 12:51   Re: change attack delay
Reply With Quote #2

Not tested but should work.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new bool:gCanShoot33 ];

public 
plugin_init() 
{
    
register_plugin"Shot Delay/Restrict""0.1""hornet" );
    
    
RegisterHamHam_Spawn"player""hamPlayerSpawn");
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_awp""hamPrimaryAtkAWP" );
}

public 
hamPlayerSpawnid )
{
    
remove_taskid );
    
gCanShootid ] = true;
}

public 
hanPrimaryAtkAWPent )
{
    new 
id peventpev_owner );
    
    if( 
gCanShootid ] )
    {
        
gCanShootid ] = false;
        
set_task30.0"Reset"id );
    }
    else return 
HAM_SUPERCEDE;
    
    return 
PLUGIN_CONTINUE;
}

public 
Resetid )
{
    
gCanShootid ] = true;

hornet is offline
Reply


Thread Tools
Display Modes

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 14:37.


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