View Single Post
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-11-2018 , 03:25   Re: [CS:S] Hooking Secondary Knife Attack
Reply With Quote #7

PHP Code:
public Action OnPlayerRunCmd(int clientintbuttons)
{
    
int pressedButtons GetEntProp(clientProp_Data"m_afButtonPressed");
    if(
pressedButtons IN_ATTACK2)
    { 
        
//Code 
    
}

    return 
Plugin_Continue;

This would tell you when +attack2 was initially pressed. The prop exists in CS:GO, you'll have to check if it exists in CS:S. If not you can always just keep track of last buttons to find out when the button is pressed.

EDIT: After thinking about it this might not be the most accurate method since clicking the button might not always correspond to the secondary attack happening, might need a different method.

Last edited by hmmmmm; 05-11-2018 at 03:29.
hmmmmm is offline