AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Want to block two console commands but i can't! (force_centerview & centerview) (https://forums.alliedmods.net/showthread.php?t=172251)

sauron_pk 11-17-2011 21:35

Want to block two console commands but i can't! (force_centerview & centerview)
 
Hi, i play team fortress classic 1.6, and in this game these two commands are ilegal, so i want to block them.

I tried some CVAR and command blockers but didn't work so i decided to make my own plugin... Basically when these two commands are executed i want to kick the user, but the plugin doesn't work and it's seem to be all ok...

Here is the code:
Code:

#include <amxmodx>

public plugin_init()
{
        register_plugin("CMDBlock","1.0","CMDBlock")
        register_clcmd("centerview","block")
        register_clcmd("force_centerview","block")
        register_concmd("centerview","block")
        register_concmd("force_centerview","block")
}

public block(id){
        new name[32]
        get_user_name(id, name, 31)
        client_print(0, print_chat, "%s has been kicked for using an ilegal command", name)
        return PLUGIN_HANDLED;
}

Any ideas?
Thanks!

fysiks 11-18-2011 00:42

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
They are likely never sent to the server. Therefore you can't detect them [this way].

sauron_pk 11-18-2011 03:50

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
thanks for reply!

yup, seems that they are not sent to server..

so.. is there any chance to block them in another way?

Devil259 11-18-2011 06:09

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
Maybe.

You forgot to kick the player in your function.

sauron_pk 11-18-2011 15:28

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
yeap but i can't see the message so is the same, isn't calling the function because the command don't send anything to server

Backstabnoob 11-18-2011 19:23

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
What do these commands do?

sauron_pk 11-19-2011 00:58

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
force_centerview // forces the player's view to look straight ahead

centerview // centers the players view


There is a concussion grenade in the game that dizzy you (? so the crosshair start to moving like you are confused, so with this commands you can know where is the crosshair(in the center of the screen)...

kramesa 11-19-2011 13:59

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("CMDBlock""1.0""Author")
    
register_clcmd("centerview""block")
    
register_clcmd("force_centerview""block")
    
register_concmd("centerview""block")
    
register_concmd("force_centerview""block")
}

public 
block(id)
{
    new 
name[32
    
get_user_name(idname31
    
client_print(0print_chat"%s has been kicked for using an ilegal command"name)
    
server_cmd("kick #%d ^"%s^""get_user_userid(id), "Ilegal command"
    return 
PLUGIN_HANDLED;


Add comand kick

Backstabnoob 11-19-2011 14:30

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
Quote:

Originally Posted by kramesa (Post 1599234)
PHP Code:

#include <amxmodx>

public plugin_init()
{
    
register_plugin("CMDBlock""1.0""Author")
    
register_clcmd("centerview""block")
    
register_clcmd("force_centerview""block")
    
register_concmd("centerview""block")
    
register_concmd("force_centerview""block")
}

public 
block(id)
{
    new 
name[32
    
get_user_name(idname31
    
client_print(0print_chat"%s has been kicked for using an ilegal command"name)
    
server_cmd("kick #%d ^"%s^""get_user_userid(id), "Ilegal command"
    return 
PLUGIN_HANDLED;


Add comand kick

no

Erox902 11-19-2011 14:32

Re: Want to block two console commands but i can't! (force_centerview & centerview)
 
Quote:

Originally Posted by kramesa (Post 1599234)
Add comand kick

Why don't you read before you comment?
Quote:

Originally Posted by sauron_pk (Post 1598695)
yeap but i can't see the message so is the same, isn't calling the function because the command don't send anything to server



All times are GMT -4. The time now is 08:32.

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