AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   intercept the cmd command (https://forums.alliedmods.net/showthread.php?t=10266)

kaboomkazoom 02-13-2005 17:26

intercept the cmd command
 
Is it possible to see which client executed the "cmd" command from his console ? I want to trace the command
Code:

cmd name "whatever you want"
which when executed from any client on a CS 1.5 server, changes the name of the sever to "whatever you want", which is very irritating.

I tried "register_concmd" & "register_clcmd" but they don't work for "cmd". I also tried "client_command" this also works for other commands like "say" or "kill" but don't works for "cmd"

the code that i wrote is as follows:
Code:
#include <amxmodx> #include <amxmisc> public client_command(id) {     new comm[10], name[20]     get_user_name (id, name, 19)     read_argv (0,comm,9)     if (contain(comm,"cmd")!=-1)         client_print(0,print_chat,"cmd command was run by : %s",name)     return PLUGIN_CONTINUE } public plugin_init() {     register_plugin("Disable cmd command","1.0","Smoke")        return PLUGIN_CONTINUE }
I have not used "return PLUGIN_HANDLED" coz then no command is able to execute on the client as the plugin stops them all. This can be handled though but thats not the main concern. the main thing is how to catch "cmd".

BlueRaja 02-13-2005 20:24

I've never heard of the cmd command.
What's it do? Sounds like rcon, from the way you describe it..
No one should be able to change the name of the server, btw, unless you give them the rcon password (or the rcon flag in amxx).

devicenull 02-13-2005 20:27

Its an exploit that is fixed on steam servers, but not WON ones. You could download files from the server with it, and execute some commands. Not sure how to catch it though, might not even be possible

BlueRaja 02-13-2005 23:33

Oh..
Well in that case, I've got a fix: use steam.

kaboomkazoom 02-14-2005 05:06

from the function list i came across a function as dllfunc. there its wrritten that clientcommand function can be called as follows
Quote:

DLLFunc_ClientCommand, // void ) ( edict_t *pEntity );
and the detail of this function is given at metamod.org as
Quote:

ClientCommand
from dlls/client.cpp:

void ClientCommand(edict_t *pEntity);

Called each time a player uses a "cmd" command. Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character string command.
but i dont know how to use this function. please if anyone could help me use this function ???


All times are GMT -4. The time now is 19:22.

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