AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Do function using key... (https://forums.alliedmods.net/showthread.php?t=140930)

SaM.ThE.MaN 10-17-2010 16:55

Do function using key...
 
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

lucas_7_94 10-17-2010 17:01

Re: Do function using key...
 
get_user_button(index)

Bugsy 10-17-2010 17:06

Re: Do function using key...
 
Quote:

Originally Posted by SaM.ThE.MaN (Post 1327829)
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


Sylwester 10-17-2010 17:15

Re: Do function using key...
 
I recently posted very simple plugin that uses button E (+use):
http://forums.alliedmods.net/showthr...00#post1326200

lucas_7_94 10-17-2010 17:48

Re: Do function using key...
 
IN_CANCEL what button is it ?

#8 SickneSS 10-18-2010 04:46

Re: Do function using key...
 
Escape Maybe?

SaM.ThE.MaN 10-18-2010 06:09

Re: Do function using key...
 
Quote:

Originally Posted by #8 SickneSS (Post 1328218)
Escape Maybe?

Hey FEDE ... long time no see :D


All times are GMT -4. The time now is 10:20.

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