Raised This Month: $ Target: $400
 0% 

Command Intercept - AMX bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
crazyfool2100
Junior Member
Join Date: Jul 2004
Old 07-17-2004 , 05:29   Command Intercept - AMX bug?
Reply With Quote #1

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
crazyfool2100 is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2004 , 05:45  
Reply With Quote #2

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.
__________________
hello, i am pm
PM is offline
crazyfool2100
Junior Member
Join Date: Jul 2004
Old 07-17-2004 , 05:59  
Reply With Quote #3

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?

crazyfool2100 is offline
BAILOPAN
Join Date: Jan 2004
Old 07-17-2004 , 06:23  
Reply With Quote #4

Yes. The special +commands are actually button/state codes, not commands.
__________________
egg
BAILOPAN is offline
crazyfool2100
Junior Member
Join Date: Jul 2004
Old 07-17-2004 , 07:08  
Reply With Quote #5

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>

new AUTH[] = "Client Intercept"
new PLUGIN_NAME[] = "clientintercept"
new VERSION[] = "0.1"


public plugin_init() { 
 
	register_plugin(PLUGIN_NAME,VERSION,AUTH)
	
} 


public client_command(id) {
   new arg1[129]
    read_argv(0, arg1, 128)
    client_print(id, print_console, "command: %s", arg1)
    return PLUGIN_CONTINUE
}
crazyfool2100 is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2004 , 11:00  
Reply With Quote #6

return PLUGIN_HANDLED
?
__________________
hello, i am pm
PM is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 07-17-2004 , 19:31  
Reply With Quote #7

so i assume there is no possible way to intercept something such as
alias +3jumps "+jump; wait; .... other stuff"
alias -3jumps "-jump"
__________________
QwertyAccess is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-18-2004 , 04:21  
Reply With Quote #8

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
__________________
hello, i am pm
PM is offline
crazyfool2100
Junior Member
Join Date: Jul 2004
Old 07-19-2004 , 02:22  
Reply With Quote #9

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:
#include <amxmodx>

new AUTH[] = "Client Intercept"
new PLUGIN_NAME[] = "clientintercept"
new VERSION[] = "0.1"


public plugin_init() { 
 
	register_plugin(PLUGIN_NAME,VERSION,AUTH)
	
} 


public client_command(id) { 
    new arg1[129]
    read_argv(0, arg1, 128)
    client_print(id, print_chat, "client_command called")
    client_print(id, print_console, "client_command called")

    client_print(id, print_console, "command: %s", arg1)
    client_print(id, print_chat, "command: %s", arg1)
    return PLUGIN_CONTINUE
   // return PLUGIN_HANDLED // tried, no work
}
I get nothing from the server (a seperate server from my client: dedicated). Anyone see an error? Or might this be an amx problem?

Argh :\
crazyfool2100 is offline
crazyfool2100
Junior Member
Join Date: Jul 2004
Old 07-19-2004 , 03:10  
Reply With Quote #10

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

=)
crazyfool2100 is offline
Reply



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 14:42.


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