Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO1 Modding Support & Discussion
  3. Setting Client DVAR's

Setting Client DVAR's

Scheduled Pinned Locked Moved BO1 Modding Support & Discussion
3 Posts 2 Posters 1.0k 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.
  • Ahrimdonundefined Offline
    Ahrimdonundefined Offline
    Ahrimdon
    wrote on last edited by Ahrimdon
    #1

    Absolute noob coder here. Wrote welcome scripts with what I've gathered from the modding community. So far everything has gone great, except for setting client DVAR's. Here's what I got so far:

    #include maps\_utility; 
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    
    init()
    {
    	level.clientid = 0;
    	level.perk_purchase_limit = 9;
    	level thread onPlayerConnect();
    }
    
    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill("connecting", player);
    		player thread onPlayerSpawned();
    		player.clientid = level.clientid;
    		level.clientid++;	// Is this safe? What if a server runs for a long time and many people join/leave
    	}
    }
    
    onPlayerSpawned()
    {
    	level endon( "game_ended" );
            self endon( "disconnect" );
    	for(;;)
    	{
    		self waittill( "spawned_player" );
    		
    		self.num_perks = -5; //Remove perk limit, must be a negative number
    
    		wait ( 10 );
    		self iPrintLnBold("Welcome to ^1Rimmy's Server^7!");
    		wait ( 5 );
    		self iPrintLnBold("^5Perk Limit ^1Removed");
    		wait ( 5 );
    	}
    }
    

    For setting DVAR's, I've tried adding:

    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill("connecting", player);
    		player thread onPlayerSpawned();
    		player.clientid = level.clientid;
    		level.clientid++;	// Is this safe? What if a server runs for a long time and many people join/leave
    		self SetClientDvars( "cg_deadChatWithDead", "1",
    		"cg_deadChatWithTeam", "1",
    		"cg_deadHearTeamLiving", "1",
    		"cg_deadHearAllLiving", "1",
    		"cg_everyoneHearsEveryone", "1",
    		"r_fog", "0",
    		"cg_drawSpectatorMessages", "1",
    		"r_lodbiasrigid", "-1000",
    		"r_lodbiasskinned", "-1000" );
    	}
    }
    

    Along with:

    init()
    {
    	level.clientid = 0;
    	level.perk_purchase_limit = 9;
    	level thread onPlayerConnect();
    	level.reset_clientdvars = ::onPlayerConnect_clientDvars;
    }
    

    and using a function to define (think that's the right word) level.reset_clientdvars = ::onPlayerConnect_clientDvars; using the client DVAR's, along with a few other syntax variations. So far no luck. If anyone wouldn't giving a few tips on this it would be much appreciated.

    1 Reply Last reply
    0
    • Sorexundefined Offline
      Sorexundefined Offline
      Sorex
      Contributor
      wrote on last edited by
      #2

      Ahrimdon

      self SetClientDvars( "cg_deadChatWithDead", "1", ... )
      

      you call that on self instead of player, self is level in that place.

      Ahrimdonundefined 1 Reply Last reply
      1
      • Sorexundefined Sorex

        Ahrimdon

        self SetClientDvars( "cg_deadChatWithDead", "1", ... )
        

        you call that on self instead of player, self is level in that place.

        Ahrimdonundefined Offline
        Ahrimdonundefined Offline
        Ahrimdon
        wrote on last edited by
        #3

        Sorex Worked like a charm! Thank you very much!

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        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
        • Unread 0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups