Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sauron_pk
Junior Member
Join Date: Oct 2011
Old 11-17-2011 , 21:35   Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #1

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!
sauron_pk is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-18-2011 , 00:42   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #2

They are likely never sent to the server. Therefore you can't detect them [this way].
__________________

Last edited by fysiks; 11-18-2011 at 00:42.
fysiks is offline
sauron_pk
Junior Member
Join Date: Oct 2011
Old 11-18-2011 , 03:50   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #3

thanks for reply!

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

so.. is there any chance to block them in another way?
sauron_pk is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-18-2011 , 06:09   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #4

Maybe.

You forgot to kick the player in your function.
Devil259 is offline
sauron_pk
Junior Member
Join Date: Oct 2011
Old 11-18-2011 , 15:28   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #5

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
sauron_pk is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2011 , 19:23   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #6

What do these commands do?
Backstabnoob is offline
sauron_pk
Junior Member
Join Date: Oct 2011
Old 11-19-2011 , 00:58   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #7

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)...
sauron_pk is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 11-19-2011 , 13:59   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #8

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
__________________
kramesa is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-19-2011 , 14:30   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #9

Quote:
Originally Posted by kramesa View Post
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
Backstabnoob is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 11-19-2011 , 14:32   Re: Want to block two console commands but i can't! (force_centerview & centerview)
Reply With Quote #10

Quote:
Originally Posted by kramesa View Post
Add comand kick
Why don't you read before you comment?
Quote:
Originally Posted by sauron_pk View Post
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

Last edited by Erox902; 11-19-2011 at 14:33.
Erox902 is offline
Reply


Thread Tools
Display Modes

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 08:32.


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