Raised This Month: $32 Target: $400
 8% 

Do function using key...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-17-2010 , 16:55   Do function using key...
Reply With Quote #1

Hi ... i would like to know , Is there a way to do this


public function(id)
{
if Player presses E
{
// my script
}
}

Tried searching , got nothing
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-17-2010 , 17:01   Re: Do function using key...
Reply With Quote #2

get_user_button(index)
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-17-2010 , 17:06   Re: Do function using key...
Reply With Quote #3

Quote:
Originally Posted by SaM.ThE.MaN View Post
Hi ... i would like to know , Is there a way to do this


public function(id)
{
if Player presses E
{
// my script
}
}

Tried searching , got nothing
You can't hook a particular key\button unless the user binds a function to that key. You can hook the below, though (E is default for IN_USE).

Use fakemeta FM_CmdStart to hook this, search if you don't know how as this has been covered numerous times.

Code:
#define IN_ATTACK                       (1<<0)
#define IN_JUMP                         (1<<1)
#define IN_DUCK                         (1<<2)
#define IN_FORWARD                      (1<<3)
#define IN_BACK                         (1<<4)
#define IN_USE                          (1<<5)
#define IN_CANCEL                       (1<<6)
#define IN_LEFT                         (1<<7)
#define IN_RIGHT                        (1<<8)
#define IN_MOVELEFT                     (1<<9)
#define IN_MOVERIGHT                    (1<<10)
#define IN_ATTACK2                      (1<<11)
#define IN_RUN                          (1<<12)
#define IN_RELOAD                       (1<<13)
#define IN_ALT1                         (1<<14)
#define IN_SCORE                        (1<<15)     // Used by client.dll for when scoreboard is held down
__________________
Bugsy is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-17-2010 , 17:15   Re: Do function using key...
Reply With Quote #4

I recently posted very simple plugin that uses button E (+use):
http://forums.alliedmods.net/showthr...00#post1326200
__________________
Impossible is Nothing
Sylwester is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-17-2010 , 17:48   Re: Do function using key...
Reply With Quote #5

IN_CANCEL what button is it ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 10-18-2010 , 04:46   Re: Do function using key...
Reply With Quote #6

Escape Maybe?
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-18-2010 , 06:09   Re: Do function using key...
Reply With Quote #7

Quote:
Originally Posted by #8 SickneSS View Post
Escape Maybe?
Hey FEDE ... long time no see
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Reply


Thread Tools
Display Modes

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 07:10.


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