Need help with sv_cheats

Topic created ยท 10 Posts ยท 259 Views
  • So I'm creating a infected server which I've made some progress but I'm stuck on some server settings such as "sv_cheats 1". I need some commands in able to make my server the way I want example.

    gsc.setDvar("jump_height", 46)
    gsc.setDvar("jump_autobunnyhop", 0)
    gsc.setDvar("jump_stepSize", 256)

    *However I have to have sv_cheats 1 in able to have these new settings changed.

    my script looks like this

        gsc.setDvar("jump_slowDownEnable", 1)
        gsc.setDvar("jump_disableFallDamage", 0)
        gsc.setDvar("sv_cheats", 1)
        gsc.setDvar("jump_slowdownEnable", "0")
        gsc.setDvar("jump_autobunnyhop", 0)
        gsc.setDvar("jump_height", 46)
        gsc.setDvar("sv_enableBounces", 1)
        gsc.setDvar("jump_stepSize", 256)
        gsc.setDvar("jump_ladderPushVel", 1024)
        gsc.setDvar("g_speed", 225)
        
    
        setTimeout(fun() {
            gsc.setDvar("jump_slowDownEnable", 0)
            gsc.setDvar("jump_disableFallDamage", 1)
        }, 0)
    })```
    
    The biggest problem is people being able to noclip, godmode, etc.
    
    I also got helped by a staff member on your guys discord server and he told me to do this.
    
    level.onNotify("connected", fun[](args) {
        var player = args[0]
    
        gsc.setDvar("sv_cheats", 1)
        gsc.setDvar("jump_height", 46)
    
        setTimeout(fun() {
    
        gsc.setDvar("sv_cheats", 0)
        gsc.setDvar("jump_height", 46)
            }, 0)
    })
    
    This couldn't set the jump height no matter what. And yes this is in my `Storage/IW5/Scripts folder` 
    
    So i basically need help if i can use the commands with out sv_cheats 1 or can someone please make a quick script for me on auto kicking people when they use noclip. If not thanks for reading my issue:/ Have a great day, or night:)
  • @Slxxpy I am not a staff member just a vip / donator and I told you that you needed the clantag plugin for it to work with what is posted but ignore me. there is a github for the clantag plugin so you can see on how that works.

  • @Slxxpy said in Need help with sv_cheats:

    the jump height

    The reason this does not work is because of the nature of sv_cheats. When you change it to 1 it allows you to edit any dvars like you want. The problem is when you change it back to 0, the game also goes through every single cheat protected dvar and resets those as well. So the only way to have a cheat-protected dvar stay modified is to leave sv_cheats at 1.

    Your other option would be to create a server plugin in c++ that removes the cheat protection on the specific dvars you want for your server. But that is a lot more complicated, and not something that I am going to explain here

  • @Matrix Alright thank you:) much more helpful, informative and nicer๐Ÿ‘

  • Must be that scripts are parsed before the DVAR reset function, this would be an issue. What happens is your script does successfully set them you just never see it because by the time you do see their values, they're already reset. It WAS intended that you should never need to set sv_cheats to set any DVAR with scripting. This is an issue I will need to look into.

  • @Dasfonia Alright thank you very much:)

  • @Slxxpy check out the latest update, should fix the issues mentioned in this thread. Just set the dvar without any of the fancy onPlayerSpawned code or anything like that. Should be fixed now ๐Ÿ‘

  • @Dasfonia alr ty, I will test it out later:)

  • @Dasfonia ty so much it worked:)

  • Thanks for the feedback, the problem is solved this thread can now be locked. ๐Ÿ‘

Log in to reply