Raised This Month: $ Target: $400
 0% 

Hooking player actions (+reload, +attack2, etc)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 03-23-2021 , 12:01   Re: Hooking player actions (+reload, +attack2, etc)
Reply With Quote #14

Quote:
Originally Posted by ImACow View Post
How would one hook into client commands, without the runcmd/gameframe?

I'm interested in detecting if a player presses "+reload" on their knife / gun
PHP Code:

public void OnPlayerRunCmdPost(int clientint buttonsint impulse, const float vel[3], const float angles[3], int weaponint subtypeint cmdnumint tickcountint seed, const int mouse[2])
{
    if (
view_as<bool>(buttons IN_RELOAD))
    {
        
int wp GetEntPropEnt(clientProp_Send"m_hActiveWeapon");
        if (
wp == -1)
        {
            return 
Plugin_Continue;
        }

        
// we have the weapon, check here if is knife etc
    
}

    return 
Plugin_Continue;

__________________
Ilusion9 is offline
 



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 13:12.


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