AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How do you block a client command? (https://forums.alliedmods.net/showthread.php?t=86662)

shadow.hk 03-01-2009 00:04

How do you block a client command?
 
Making a script to automatically set the fps to 131 on client connect and just wondering how you can get it to block a certain command?

Here's the script

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "FPS Blocker"
#define VERSION "1.0"
#define AUTHOR "shadow.hk"
new fps_message[] = "You're FPS has been automatically set to 131"
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
}
public 
client_putinserver()
{
 
set_task(5.0,"fps_set")
}
public 
fps_set(id)
{
 
client_cmd(id,"fps_max 131")
 
client_cmd(id,"developer 1")
 
client_print(id,print_chat,"[CZ] %s",fps_message)
}
public 
client_disconnect(id)
{
 
remove_task(id)


I'm fairly new at this, so I'm not too sure on what to use.

I'm trying to block any FPS value of over 131.

fysiks 03-01-2009 01:03

Re: How do you block a client command?
 
I didn't think monitors could refresh that fast. If you want everybody to be on the same "viewing level" you could just limit your updaterate for your server.

I use fps_max 75 and I wouldn't want anyone to change it.

Also, is the developer command just part of your testing process?

danielkza 03-01-2009 01:04

Re: How do you block a client command?
 
Quote:

Originally Posted by fysiks (Post 771383)
I didn't think monitors could refresh that fast. If you want everybody to be on the same "viewing level" you could just limit your updaterate for your server.

I use fps_max 75 and I wouldn't want anyone to change it.

Also, is the developer command just part of your testing process?

You can't get FPS > 100 without developer set to 1.

fysiks 03-01-2009 01:05

Re: How do you block a client command?
 
Quote:

Originally Posted by danielkza (Post 771384)
You can't get FPS > 100 without developer set to 1.

But, then you have a bunch of console code on your screen. :(

shadow.hk 03-01-2009 01:10

Re: How do you block a client command?
 
This is for a surf server, where the accepted standard is 131 fps. Anything higher makes it much easier to surf and gives people an unfair advantage, especially on timed maps.

Is there a way to block all fps and developer commands?

danielkza 03-01-2009 01:13

Re: How do you block a client command?
 
Quote:

Originally Posted by shadow.hk (Post 771386)
This is for a surf server, where the accepted standard is 131 fps. Anything higher makes it much easier to surf and gives people an unfair advantage, especially on timed maps.

Is there a way to block all fps and developer commands?

No good way, clients can alias commands after their first use, effectively making client_cmd useless. What you should do is check fps_max's value through query_client_cvar. If it's not below 131, then try to set it using client_cmd. Re-check the cvar: if it's still not within range, kick the player.

shadow.hk 03-01-2009 01:19

Re: How do you block a client command?
 
I'm new to scripting, so I'm not exactly sure how to do that :(

ConnorMcLeod 03-01-2009 03:16

Re: How do you block a client command?
 
The plugin already exists on the forum, please search for it.


All times are GMT -4. The time now is 17:00.

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