Raised This Month: $51 Target: $400
 12% 

Simulate Buttons Alt-Fire / IN_ATTACK2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 12-06-2017 , 16:37   Simulate Buttons Alt-Fire / IN_ATTACK2
Reply With Quote #1

Is there a way to set the current players weapon to "think" the player is pressing alt-fire, or IN_ATTACK2? I am trying to get a weapon to have a certain effect, but it will only do it if you hold down alt-fire. Not sure any other way to go about it...

Here is my extremely basic stock:

PHP Code:
stock SetWeaponMode(client)
    
int iActiveWeapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon");

    if(
IsValidEdict(iActiveWeapon))
    {
        
// ... Simulate Holding Alt-Fire
    
}

__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT

Last edited by scorpius2k1; 12-06-2017 at 16:37.
scorpius2k1 is offline
sdz
Senior Member
Join Date: Feb 2012
Old 12-10-2017 , 05:54   Re: Simulate Buttons Alt-Fire / IN_ATTACK2
Reply With Quote #2

you could probably get away with using this in this
PHP Code:
public Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weaponint &subtypeint &cmdnumint &tickcountint &seedint mouse[2])
{
    if(
condition)
    {
        
buttons &= (buttons IN_ATTACK2);
        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;


Last edited by sdz; 12-10-2017 at 05:54.
sdz is offline
Reply



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 20:58.


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