Setting Client DVAR's
-
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. -
self SetClientDvars( "cg_deadChatWithDead", "1", ... )you call that on self instead of player, self is level in that place.
-
self SetClientDvars( "cg_deadChatWithDead", "1", ... )you call that on self instead of player, self is level in that place.
Sorex Worked like a charm! Thank you very much!
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