[TUT] Using Button Constants
This is a duplicate of the tutorial I made in the AMWiki in this URL: http://wiki.tcwonline.org/index.php/Button_constants
Usage Button constants are generally used to determine when an entity is doing a certain action, such as jumping, attacking, or moving. This is used because +/- commands cannot be hooked by the HL engine (if they are made by the HL engine). For example, this would work: Code:
However this would not: Code:
Constants A full list of constants can be found here: http://amxmodx.org/funcwiki.php?go=m...#const_buttons Implementation If, for example, it is desired to check when a player is attacking, one would use the following: Code:
To set an entity's button, the same type of idea can be implemented: Code:
To get an entity's buttons, and then ommit a certain button, one would use the following: Code:
There are many more ways to use button constants, and not all must be used on players. They are simply more commonly implemented when dealing with players. |
Re: Using Button Constants
Cool man..
Did u ust make these up or are they from other places? |
Re: Using Button Constants
Quote:
|
Re: Using Button Constants
Is their any alternative to catching a client command thats a HL registered one... but not buttons like +attack and such. I want to do something for ESF, but since I can only do a +Powerup one time... I can't seem to think of a work around since I am new to AMXX scripting(the natives mainly).
|
Re: Using Button Constants
Quote:
|
Re: [TUT] Using Button Constants
Do i have to check if he is alive to? Or doesn't this work with dead players?
|
Re: [TUT] Using Button Constants
Quote:
|
Re: [TUT] Using Button Constants
So does that mean if a dead player uses +attack it will be executing the code to? I'm confused.
|
Re: [TUT] Using Button Constants
Yes.
|
Re: [TUT] Using Button Constants
Okay, thanks guys
EDIT: EV_INT_BUTTON gives undefined symbol here. EDIT2: nevermind, it was EV_INT_button. |
All times are GMT -4. The time now is 22:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.