Raised This Month: $77 Target: $400
 19% 

Forbidate pressing IN_ATTACK and INT_ATTACK2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hennesy
Junior Member
Join Date: Nov 2018
Location: Ukraine
Old 06-16-2019 , 15:01   Forbidate pressing IN_ATTACK and INT_ATTACK2
Reply With Quote #1

How to prevent pressing IN_ATTACK and INT_ATTACK2 so that it was impossible to shoot even shooting animations so that there was no ... how to implement it? I tried OnPlayerRunCmd but there is still an animation as you strike or shoot! Please help
Hennesy is offline
lizzy
New Member
Join Date: Dec 2017
Old 06-16-2019 , 19:42   Re: Forbidate pressing IN_ATTACK and INT_ATTACK2
Reply With Quote #2

Quote:
Originally Posted by Hennesy View Post
How to prevent pressing IN_ATTACK and INT_ATTACK2 so that it was impossible to shoot even shooting animations so that there was no ... how to implement it? I tried OnPlayerRunCmd but there is still an animation as you strike or shoot! Please help
Perhaps this thread will help: Block shooting - started by Grayscale
lizzy is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 06-19-2019 , 17:57   Re: Forbidate pressing IN_ATTACK and INT_ATTACK2
Reply With Quote #3

Sorry for late response
PHP Code:

//To block attack
CreateTimer(0.3Timer_BlockAttackclientTIMER_REPEAT);
//
public Action Timer_BlockAttack(Handle tint client)
{
    if(...)
    {
        return 
Plugin_Handled;//allow attack
    
}
    
BlockAttack(client);
    return 
Plugin_Continue;
}

void BlockAttack(int client)
{
    
int weapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon");
            
    if (
IsValidEntity(weapon))
    {
        
char sClass[32];
        
GetEntityClassname(weaponsClasssizeof(sClass));
                
        if (
StrContains(sClass"weapon_"false) > -1)
        {
            
SetEntPropFloat(weaponProp_Send"m_flNextPrimaryAttack"GetGameTime() + 0.5);
            
SetEntPropFloat(weaponProp_Send"m_flNextSecondaryAttack"GetGameTime() + 0.5);
        }
    }    

__________________

Last edited by impossible_cc; 06-24-2019 at 06:51. Reason: SetEntDataFloat instead of SetEntPropFloat
impossible_cc 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 06:54.


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