AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing client cvars. (https://forums.alliedmods.net/showthread.php?t=114248)

.OM NOM NOM NOM 01-03-2010 00:33

Changing client cvars.
 
Good day to you gentlemen, and happy New Year.
I've been looking over scripting tutorials for some time now, it seems like my miserable brain can't handle even 30 lines of code.


I’m trying to make a client change a cvar by typing a specific message to mm1/2 -- chat.

Ex:

*** 1337 monkey killa King Kong *** types: /fps
Instantly forcing his fps_max to 101.

<3

One 01-03-2010 00:37

Re: Changing client cvars.
 
you mean something like this?

PHP Code:


#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /fps","do_fps")
    
    
// Add your code here...
}
public 
do_fps(id)
{
    
client_cmd(id,"fps_max 101")



.OM NOM NOM NOM 01-03-2010 00:41

Re: Changing client cvars.
 
Ok, now I feel bad.
That's exactly what I need.

fysiks 01-03-2010 01:28

Re: Changing client cvars.
 
Deja vu?

You know, they could just type the cvar in console.

platzpatrone 01-03-2010 02:16

Re: Changing client cvars.
 
Quote:

Originally Posted by fysiks (Post 1041012)
Deja vu?

yes, http://forums.alliedmods.net/showthread.php?t=114120

its same like bumping :oops:

.OM NOM NOM NOM 01-03-2010 03:04

Re: Changing client cvars.
 
#5
http://sexyurl.info/cookies

Doc-Holiday 01-03-2010 04:08

Re: Changing client cvars.
 
ppl go crazy with these though even though you guys do not support slow hacking it still happens....

.OM NOM NOM NOM 01-03-2010 07:47

Re: Changing client cvars.
 
PHP Code:

      new Float:f_value str_to_float(value);
      if(
f_value <= 0.01 || f_value >= 0.01)
{
      
console_cmd(id,"rate 20000");
      
console_cmd(id,"cl_rate 20000");
      
console_cmd(id,"cl_cmdrate 100");
      
console_cmd(id,"cl_updaterate 100");
      
console_cmd(id,"ex_interp 0.03");


My powers are growing.

Exolent[jNr] 01-03-2010 20:32

Re: Changing client cvars.
 
Note:
Changing a client's settings (such as cvars, binds, etc.) is not allowed until the client has accepted the fact that your server will do that.
You can do this through a menu or by client entering a command, etc.
Doing so without the client's permission is called slowhacking and is not allowed.


All times are GMT -4. The time now is 04:10.

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