Raised This Month: $ Target: $400
 0% 

"Hooking" and over-riding +attack


Post New Thread Reply   
 
Thread Tools Display Modes
SAMURAI16
BANNED
Join Date: Sep 2006
Old 10-02-2008 , 11:58   Re: "Hooking" and over-riding +attack
Reply With Quote #11

Code:
public example(client) {     new buttons = GetClientButtons(client);         if(buttons & IN_ATTACK)         buttons &= ~IN_ATTACK;         SetClientButtons(client,buttons);     } stock SetClientButtons(client,buttons) {     return SetEntProp(client, Prop_Data, "m_nButtons",buttons); }

I'm not familiar with TF2. Only thing i have in mind is OnGameFrame()
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 10-03-2008 , 13:42   Re: "Hooking" and over-riding +attack
Reply With Quote #12

I tested this one in TF2:

PHP Code:
public OnGameFrame() {
    for ( new 
<= GetMaxClients() ; i++ ) {
        if ( 
IsClientInGame(i) ) {
            new 
buttons GetEntProp(iProp_Data"m_nButtons");
            
buttons |= IN_ATTACK;
            
SetEntProp(iProp_Data"m_nButtons",buttons);
        }
    }

this should let fire my gun all the time or?

but it has no effect ... any idea why?
and are there other ways to let a client begin to fire his weapon?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
SAMURAI16
BANNED
Join Date: Sep 2006
Old 10-03-2008 , 14:06   Re: "Hooking" and over-riding +attack
Reply With Quote #13

that will force player to fire a weapon
I guess it's enough to set IN_ATTACK buttons for fire weapon. A check for player's weapon and if is active would be good

About your question, what you mean by "let client begin to fire his weapon" ? What can stop that ?
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 10-03-2008 , 14:17   Re: "Hooking" and over-riding +attack
Reply With Quote #14

Quote:
Originally Posted by SAMURAI16 View Post
that will force player to fire a weapon
like i said, it does not ...

and that was my question, how to force it
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
SAMURAI16
BANNED
Join Date: Sep 2006
Old 10-03-2008 , 15:07   Re: "Hooking" and over-riding +attack
Reply With Quote #15

hmm seems buttons get reset before ProcessUsrcmds. For now i don't think it's possible to force a weapon fire; Wait for next DukeHacks release
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 10-03-2008 , 15:27   Re: "Hooking" and over-riding +attack
Reply With Quote #16

I'll be adding a ProcessUsrcmds hook soon per SAMURAI16's request which will allow you to change buttons before that function is processed by the game.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke 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 21:35.


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