Command Intercept - AMX bug?
Hey,
I am trying to create a logging plugin that logs a specific set of commands that are implemented by metamod plugins. I know that it is possible to intercept commands with the client_command function (ie kill, say). I also know that it is possible to intercept commands like +attack and +moveleft using prethink. However, what I have not seen (and yes i searched the board for quite a while) is how to intercept custom +namehere commands, such as +hook. Lets say i wanted to intercept +hook from a client, I couldnt use prethink (atleast this is my understanding) becuase it isnt a built in command. I looked at the examples for intercepting +attack and it uses the constant IN_ATTACK or something. I dont think there is a constant for +hook or any other custom +namehere commands. Is there anyway to intercept custom +namehere commands? Any help would be greatly appriciated |
Intercepting custom commands is a bit tricky. If you want to intercept a command registered by an other metamod plugin, you have to make sure that amxx comes first in the plugins list. Also, if you want to register a command that was registered by an AMXX plugin, make sure your plugin comes first (or last? I don't remember) in the plugins.ini and try returning PLUGIN_HANDLED.
|
I am trying to intercept commands from another metamod plugin ;). I read on a post that they could use client_command to incetcept commands (ie kill) but not +commands (he was trying to intercept +attack). Is this problem only for built in +commands? If so, will it be possible to intercept custom +commands with client_command?
:) |
Yes. The special +commands are actually button/state codes, not commands.
|
I am trying to see everything that I can intercept, but for some reason this does not work. I have been staring at it and i cannot see what is wrong
Setup: Svencoop 3.0 Entmod Amx HLDS (Steam) Code:
#include <amxmodx> |
return PLUGIN_HANDLED
? |
so i assume there is no possible way to intercept something such as
alias +3jumps "+jump; wait; .... other stuff" alias -3jumps "-jump" |
aliases are resolved client side (I assume).
I also assume waits are processed client side too, so no, you can't completly block that command :) |
Hmm, i have tried all sorts of variations of this and nothing works at all. I have turnd off all of the metamod plugins so only amx is running, but it still doesnt work. Is this a bug in the current release of amx that should be looked at, becuase i cannot see what is wrong :\ I tried putting this at the top and the bottom of my plugins.ini file, nothin works. It compiles without any errors or warnings and when i look at amx_plugins, it is running.
Code:
Argh :\ |
Wow, i redownloaded 0.16 and it works now. I was using someones modified 0.16 version of amxx_mm.dll becuase of some crash error it claimed to fix
=) |
| All times are GMT -4. The time now is 14:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.