AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] How to block Cheat Commands (https://forums.alliedmods.net/showthread.php?t=175114)

Steveh 12-30-2011 09:57

[TF2] How to block Cheat Commands
 
Hi,

I have a plugin which requires the sv_cheats cvar to be 1 to work properly. I am wondering if anyone knows how to block cheat commands such as noclip, god, buddha, etc.

I have tried the same methods as the Cheat Control plugin uses, but unfortunately this doesn't block said cheat commands.

Thanks!
Steveh

turtsmcgurts 12-30-2011 12:50

Re: [TF2] How to block Cheat Commands
 
I'm not completely positive, but you should be able to hook each command with RegConsoleCmd then put return Plugin_Handled; inside of it.

However, are you sure that you need to have sv_cheats enabled for your plugin? I know that you can adjust cheat values without actually turning cheats on.

I would look into option two because otherwise you would have a lot of commands to hook.

Steveh 12-31-2011 19:45

Re: [TF2] How to block Cheat Commands
 
Hi,

I have tried the first method, that didn't work unfortunately.

The reason the server needs cheats on is because in TF2, the change in host_timescale doesn't take effect on clients.

Otherwise, if cheats are off and the host_timescale is changed on the server, the value is replicated to the clients, but doesn't work the same as if cheats were on.


Steveh

turtsmcgurts 12-31-2011 20:20

Re: [TF2] How to block Cheat Commands
 
Quote:

Originally Posted by Steveh (Post 1623012)
Hi,

I have tried the first method, that didn't work unfortunately.

The reason the server needs cheats on is because in TF2, the change in host_timescale doesn't take effect on clients.

Otherwise, if cheats are off and the host_timescale is changed on the server, the value is replicated to the clients, but doesn't work the same as if cheats were on.


Steveh

I know i'm kind of going around what you're asking for, but I believe it would be more efficient.

What exactly are you trying to get out of host_timescale? If you're trying to change client speed
Code:

SetEntDataFloat(client,FindSendPropInfo("CTFPlayer", "m_flMaxspeed"), newSpeed);
or, perhaps, you need it to decrease the game time quicker? I don't know of a way to change it besides editing the rcon command mp_timelimit.

Hopefully this helps; I would answer your question directly but I don't know how you would go about blocking the command : 3

Post thought: You could loop through the commands looking for FCVAR_CHEATS with "GetCommandFlags". However, after a little research, I found...
Quote:

Originally Posted by bl4nk (Post 626417)
Hook the command and "return Plugin_Handled;". Some things can not be blocked though as they happen client side as well.


Dr. McKay 12-31-2011 20:42

Re: [TF2] How to block Cheat Commands
 
This might possibly work, but I don't know.

PHP Code:

SetConVarInt(FindConVar("host_timescale"), new_value);
for(new 
0<= MAXPLAYERSi++) {
    
SetFakeClientConVar(i"host_timescale"new_value);



Steveh 01-01-2012 12:25

Re: [TF2] How to block Cheat Commands
 
Hi,

I'm going to give changing the Player's speed a try, and the SetFakeClientConVar a try aswell.

I'll reply back soon with the results ^^

Steveh 01-03-2012 04:36

Re: [TF2] How to block Cheat Commands
 
Hi,

I tried the SetFakeClientConVar, but that is only for Fake Clients (Bots). I will give changing the player speed a go. I also found Tickrate_Enabler Server Plugin, that changes the Tickrate of the server, and I thought maybe I would be able to change the host_timescale from there?

I'm not sure, but I'll post my findings here.


Cheers

Mecha the Slag 01-03-2012 19:29

Re: [TF2] How to block Cheat Commands
 
Quote:

Originally Posted by Steveh (Post 1624291)
I tried the SetFakeClientConVar, but that is only for Fake Clients (Bots)

No it's not

It sends a value to the specific client, making the client think said convar is the specific value; when it's not really.

Dr. McKay 01-03-2012 20:38

Re: [TF2] How to block Cheat Commands
 
Quote:

Originally Posted by Mecha the Slag (Post 1624829)
No it's not

It sends a value to the specific client, making the client think said convar is the specific value; when it's not really.

No, he's correct. I gave him the wrong function. The one you want is SendConVarValue.


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

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