Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Server Hosting Support
  3. How to make it so the default state of certain dvars are changed for every player when they join?

How to make it so the default state of certain dvars are changed for every player when they join?

Scheduled Pinned Locked Moved BO2 Server Hosting Support
4 Posts 2 Posters 661 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DoubleG17undefined Offline
    DoubleG17undefined Offline
    DoubleG17
    Contributor
    wrote on last edited by
    #1

    I'd like it so the server sets r_LodBiasRigid and r_LodBiasSkinned to -1000 for every player that joins but I can't seem to figure out how to do that or any documentation that shows how to get the server to change default dvars for every player that joins.

    JezuzLizardundefined 1 Reply Last reply
    0
    • DoubleG17undefined DoubleG17

      I'd like it so the server sets r_LodBiasRigid and r_LodBiasSkinned to -1000 for every player that joins but I can't seem to figure out how to do that or any documentation that shows how to get the server to change default dvars for every player that joins.

      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by JezuzLizard
      #2

      DoubleG17 If you want to set a client dvar you need to use GSC by using:

      player setClientDvar( dvarname, value );
      

      Some dvars can't be set by the server because of the potential for abuse though.

      DoubleG17undefined 1 Reply Last reply
      0
      • JezuzLizardundefined JezuzLizard

        DoubleG17 If you want to set a client dvar you need to use GSC by using:

        player setClientDvar( dvarname, value );
        

        Some dvars can't be set by the server because of the potential for abuse though.

        DoubleG17undefined Offline
        DoubleG17undefined Offline
        DoubleG17
        Contributor
        wrote on last edited by
        #3

        JezuzLizard I cannot get this command to work to save my life. I will admit I'm basically a noob when it comes to gsc. I have to use those commands using a gsc script when the server is first loaded right? I use the example gsc script and edit it with the commands I want executed via gsc and this ```

        init()
        {
            level thread onplayerconnect();
        }
        
        onplayerconnect()
        {
            for(;;)
            {
                level waittill("connected", player);
                player thread onplayerspawned();
            }
        }
        
        onplayerspawned()
        {
            self endon("disconnect");
            for(;;)
            {
                self waittill("spawned_player");
        	setdvar("r_lodBiasRigid", "-1000");
        	setdvar("r_lodBiasSkinned", "-1000");
        	setdvar("r_dof_enable", "0");
                self iprintlnbold("Draw Distance Enabled");
            }
        }
        

        works in custom games and solo but when I change the setdvar commands to player setClientDvar it doesn't change the dvars and the Draw Distance Enabled doesn't even show up on the screen so I think I'm doing something completely wrong to break the script or I'm misunderstanding how to implement the setclientdvar command. Thanks in advance.

        1 Reply Last reply
        1
        • DoubleG17undefined Offline
          DoubleG17undefined Offline
          DoubleG17
          Contributor
          wrote on last edited by
          #4

          I'm an Idiot I had to put "player setClientDvar" under the onplayerconnect function not the onplayerspawned thread

          1 Reply Last reply
          1
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Donate