Raised This Month: $ Target: $400
 0% 

How do you block a client command?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 03-01-2009 , 00:04   How do you block a client command?
Reply With Quote #1

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.
shadow.hk is offline
Send a message via MSN to shadow.hk
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-01-2009 , 01:03   Re: How do you block a client command?
Reply With Quote #2

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?
__________________

Last edited by fysiks; 03-01-2009 at 01:05.
fysiks is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 03-01-2009 , 01:04   Re: How do you block a client command?
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
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.
__________________

Community / No support through PM
danielkza is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-01-2009 , 01:05   Re: How do you block a client command?
Reply With Quote #4

Quote:
Originally Posted by danielkza View Post
You can't get FPS > 100 without developer set to 1.
But, then you have a bunch of console code on your screen.
__________________
fysiks is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 03-01-2009 , 01:10   Re: How do you block a client command?
Reply With Quote #5

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?
shadow.hk is offline
Send a message via MSN to shadow.hk
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 03-01-2009 , 01:13   Re: How do you block a client command?
Reply With Quote #6

Quote:
Originally Posted by shadow.hk View Post
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.
__________________

Community / No support through PM
danielkza is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 03-01-2009 , 01:19   Re: How do you block a client command?
Reply With Quote #7

I'm new to scripting, so I'm not exactly sure how to do that
shadow.hk is offline
Send a message via MSN to shadow.hk
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-01-2009 , 03:16   Re: How do you block a client command?
Reply With Quote #8

The plugin already exists on the forum, please search for it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 17:00.


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