AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   change attack delay (https://forums.alliedmods.net/showthread.php?t=153796)

Nyuszy 03-29-2011 11:56

change attack delay
 
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 :D

hornet 03-29-2011 12:51

Re: change attack delay
 
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;




All times are GMT -4. The time now is 14:37.

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