AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Block client cmd command (https://forums.alliedmods.net/showthread.php?t=237529)

extream87 03-25-2014 16:57

[HELP] Block client cmd command
 
I want block some command with word "STEAM_0:1:" in console.

If i write in console xxxx STEAM_0:1: or STEAM_0:1: xxxx the player is kicked from the server.
(xxxx is some command).

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Block Cmd Word" #define VERSION "1.0" #define AUTHOR "extream87" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("//cmd word// STEAM_0:1:", "cmdcommand"); } public cmdcommand(id) {     client_print(id,print_chat,"[AMXX] Command not allowed on this server!")     set_task(2.0, "getout", id) public getout(id) {     client_cmd(id, "quit") }

YamiKaitou 03-25-2014 16:59

Re: [HELP] Block client cmd command
 
Specifically, what command?

extream87 03-25-2014 17:02

Re: [HELP] Block client cmd command
 
Various commands.

Maybe if contain (STEAM_0:1: ) cmdcommand(id)

YamiKaitou 03-25-2014 17:03

Re: [HELP] Block client cmd command
 
I don't believe there is a way. You might be able to with client_command, but I don't know exactly when that gets called

extream87 03-25-2014 17:08

Re: [HELP] Block client cmd command
 
But is possible make something like this?

Code:
register_clcmd("xxxx STEAM_0:1:", "cmdcommand");
xxxx (is some command) what i need is to check STEAM_0:1:

YamiKaitou 03-25-2014 17:17

Re: [HELP] Block client cmd command
 
You would need to hook the command that you want to block and check the parameters passed

extream87 03-25-2014 17:21

Re: [HELP] Block client cmd command
 
Check if is good now plz.
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Block Cmd Word" #define VERSION "1.0" #define AUTHOR "extream87" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd( "", "ClientCommand" ); } //here public ClientCommand (id, const player) {     if ( ~get_user_flags( player ) & ADMIN_KICK )     {     return PLUGIN_CONTINUE;     }         static message[ 191 ];     read_argv( 1, message, charsmax( message ) );         if ( message[ 0 ] == '!' )     {     static const commandd     [] = "STEAM_0:1:";         if ( equal( message[ 1 ], commandd))     {             cmdcommand(id)     }     }     return PLUGIN_CONTINUE; } // here public cmdcommand(id) {     client_print(id,print_chat,"[AMXX] Command not allowed on this server!");     set_task(2.0, "getout", id); } public getout(id) {     client_cmd(id, "quit"); }

YamiKaitou 03-25-2014 17:23

Re: [HELP] Block client cmd command
 
Did you even try it?

extream87 03-25-2014 17:26

Re: [HELP] Block client cmd command
 
Now and not worked :(

Can you make some fix plz.

YamiKaitou 03-25-2014 17:28

Re: [HELP] Block client cmd command
 
I told you what to do. Either try client_command or hook each command that you want to block


All times are GMT -4. The time now is 05:56.

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