Hooking player actions (+reload, +attack2, etc)
I'm trying to write a plugin that involves giving a player noclip while attack2 is held. Here is the gist of what I have:
Code:
public OnPluginStart() {As far as I can tell, the listener is not even getting called at all. I've tried putting PrintToChat debug lines in there, typing +attack2 in console rather than pressing the button, just about anything I could think of. I came up with an alternate version that involves checking each usercmd for attack2 using OnPlayerRunCmd, but that seemed a bit expensive and I was hoping to avoid it. Is what I'm trying to do possible with the method I'm using? |
Re: Hooking player actions (+reload, +attack2, etc)
try that :) :
PHP Code:
|
Re: Hooking player actions (+reload, +attack2, etc)
Quote:
|
Re: Hooking player actions (+reload, +attack2, etc)
My mistake. try that:
PHP Code:
Quote:
|
Re: Hooking player actions (+reload, +attack2, etc)
While I appreciate your response, I already have that code... Like I said, I was hoping to avoid OnPlayerRunCmd. It seems a little expensive for what I want to do. What I want to know is whether I will have to use OnPlayerRunCmd or not.
|
Re: Hooking player actions (+reload, +attack2, etc)
Quote:
Incidentally, to track when a person presses or lets go of IN_ATTACK2, you're going to have to track what it was on the previous OnPlayerRunCmd as it fires continually as long as the player is doing things. |
Re: Hooking player actions (+reload, +attack2, etc)
Quote:
|
Re: Hooking player actions (+reload, +attack2, etc)
I dont under stand how it's expensive to use OnPlayerRunCmd?
something like this to make a toggle command: Code:
public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon) |
Re: Hooking player actions (+reload, +attack2, etc)
Quote:
|
Re: Hooking player actions (+reload, +attack2, etc)
Quote:
Quote:
|
| All times are GMT -4. The time now is 13:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.