Raised This Month: $ Target: $400
 0% 

detect +attack and execute code many times


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
moosewanted
Member
Join Date: May 2009
Old 05-31-2009 , 08:46   detect +attack and execute code many times
Reply With Quote #1

Hey,
I wish to detect if a player is holding down +attack / +attack2

I think I can use - register_forward( FM_CmdStart, "CmdStart" )

And then something like:

PHP Code:
public CmdStart(id)
{
    if(!
g_custom_model[id]) return FMRES_IGNORED;

    if(
pev(idpev_button) & ATTACK// is this the right button? :p
    
{
        
//other stuff here
    
}
    return 
FMRES_SUPERCEDE//This does block +attack right?

Also, will CmdStart be called as the user holds the button down. Or is it on press and release?

Thanks for the help <3
moosewanted 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 14:03.


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