Advanced Search

Author Topic: Best way to disable cheats?  (Read 2980 times)

0 Members and 1 Guest are viewing this topic.

January 14, 2011, 07:39:52 PM
Read 2980 times

Offline SickSadWorld

  • MM8BDM MM8 Contributor
  • ****
  • Date Registered: December 03, 2010, 07:35:28 AM

    • View Profile
Best way to disable cheats?
« on: January 14, 2011, 07:39:52 PM »
Is our only option to use DisableCheats in the MAPINFO lump?

Detecting sv_cheats in ACS is all fine and dandy

Code: [Select]
if ( cvar("sv_cheats") == 1 )
{
  // herpy derp
}

but then what? Just detecting it doesn't seem like enough... what options are there available?

January 14, 2011, 07:45:48 PM
Reply #1

Offline Ivory

  • MM8BDM Extender
  • *********
  • Date Registered: August 25, 2009, 08:17:59 AM

    • View Profile
    • http://www.cutstuff.net/
Re: Best way to disable cheats?
« Reply #1 on: January 14, 2011, 07:45:48 PM »
Hmm. Could just make script. Not 100% sure on this
Code: [Select]
script # OPEN
if ( cvar("sv_cheats") == 1 )
{
  delay(# of tics);
  //Coding to change the sv_cheats back to false;
  restart;
}



The result makes the script constantly restarts to see if SV_Cheats is on, if it is, turns it off, then restarts again.
Again this is just in theory, but I don't have too much time to figure out exactly what you need, just to give you a skeletal structure.

January 14, 2011, 07:50:26 PM
Reply #2

Offline SickSadWorld

  • MM8BDM MM8 Contributor
  • ****
  • Date Registered: December 03, 2010, 07:35:28 AM

    • View Profile
Re: Best way to disable cheats?
« Reply #2 on: January 14, 2011, 07:50:26 PM »
Thanks Ivory

That kind of script is exactly what I was thinking about. There's one small problem though which is why I made this thread

Code: [Select]
 //Coding to change the sv_cheats back to false;

Despite your script that implements exactly what I'm after, there doesn't seem to be any real way to actually set sv_cheats back to false. Hence this thread... is there a way to initiate a console command using ACS? People in the ZDoom community seemed nervous about the possibility of executing console commands via ACS because they suspect people would make maps that wipe people's keybinds and implement other malicious behavior.

January 17, 2011, 04:55:49 PM
Reply #3

Offline CutmanMike

  • Administrator

  • Is it hot in here or is it just zscript?
  • *******
  • Date Registered: December 17, 2008, 12:24:34 PM

    • View Profile
    • https://cutstuff.net
Re: Best way to disable cheats?
« Reply #3 on: January 17, 2011, 04:55:49 PM »
ConsoleCommand (a function unique to ST) is what you're looking for, but I'm not certain if it will work. For starters the game has to be reset once this has changed. The only way to do this is if the server (or client if in singleplayer) changes the map via the console or selects "new game".

Also I think cheats are ALWAYS available in singleplayer.

Code: [Select]
ConsoleCommand("sv_cheats 1");

January 23, 2011, 09:53:19 PM
Reply #4

Offline Nekolord

  • Standard Member

  • A blast from the past
  • Date Registered: December 04, 2010, 10:11:22 PM

    • View Profile
Re: Best way to disable cheats?
« Reply #4 on: January 23, 2011, 09:53:19 PM »
Turn on Cheats: Type in Console "Sv_cheats True"
Turn off Cheats: Type in Console "Sv_cheats False"
After Typing in the Command, restart Map/Singleplayer Mode

@Cutmanmike
They are ever available, but some of the Cheats also dont work, like "sv_infiniteammo True"

January 23, 2011, 10:11:37 PM
Reply #5

Offline Shooting Star

  • Standard Member
  • Date Registered: October 21, 2010, 03:48:28 PM

    • View Profile
Re: Best way to disable cheats?
« Reply #5 on: January 23, 2011, 10:11:37 PM »
Quote from: "Nekolord"
Turn on Cheats: Type in Console "Sv_cheats True"
Turn off Cheats: Type in Console "Sv_cheats False"
After Typing in the Command, restart Map/Singleplayer Mode

In Singleplayer cheats are always on. Restarting map needs multiplayer.

February 18, 2011, 06:10:28 PM
Reply #6

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: Best way to disable cheats?
« Reply #6 on: February 18, 2011, 06:10:28 PM »
I just saw on ZDoom wiki, you can set on MAPINFO the disablecheats code so you can't use cheats in game.

I guess this might be relevant enough for a bump.