Post: [Script/Release] SetClientDvar & GetClientDvar for saving client strings and integers
05-09-2016, 03:50 PM #1
Im_YouViolateMe
NextGenUpdate Elite
(adsbygoogle = window.adsbygoogle || []).push({});
YouViolateMe




So yeah guys, here I am again with some custom scripts. Basically I'm not going to go into too much detail because there's really not a whole lot you need to know. In BO2 there is no SetClientDvar or GetClientDvar functionality, so setting dvars for clients was impossible right? Well that's not entirely the case anymore. These two functions allow you to save integers and strings for clients and retrieve them even after the game has ended. It's pretty simple. Let's say we were using this for verification. I would call SetClientDvar to a dvar named "rdc_Verified" with "Verified" as the value and it would save to a dvar with the client's name and value. The format would be name=value; The values are saved in a custom dvar. The dvar string is then split up in GetClientDvar and each value is matched up with the client's name you want to retrieve the value for. The client would then have Verified status upon returning to the match. This could also be used for saving client's menu positioning or anything else that you want the client to be able to save. To clear this up for you, no this is NOT for setting host-only dvars on clients. This is for saving variables for clients!

I've also included 2 extra functions StringContains and getIndexOf (both required). If you know C#, you'll be familiar with what these 2 functions do.


One thing to mention is that I don't know how much data the dvar's can hold!
Also be sure NOT to thread the function! This could cause unwanted results!

Source:
You must login or register to view this content.

There's really no credits needed, as these functions were written by me. So yeah, enjoy.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 11 users say thank you to Im_YouViolateMe for this useful post:

/SneakerStreet/, BlueeHasSwag, codybenti, DF_AUS, DoraTheKiller97, HiddenHour, iRnZ, oCmKs_4_LiFe, Patrick, S63, xTiibo Modz
05-10-2016, 03:13 PM #11
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by dorathekiller97 View Post
You need the GetName function which isnt posted here..???


Oh my bad, I'll update the source.
05-10-2016, 03:16 PM #12
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by john
Can you set actual game dvars, like fov and whatnot with this? Otherwise, I wouldn't really call it "setClientDvar"


Like SC58 said, it's just for Verification and saving strings/integers, so when a game ends you'll have access to those strings/integers. Not actually setting host/game dvars on clients. I figured to call it SetClientDvar because it was saving data for the client.
05-10-2016, 03:22 PM #13
oCmKs_4_LiFe
< ^ > < ^ >
Originally posted by YouViolateMe View Post
Like SC58 said, it's just for Verification and saving strings/integers, so when a game ends you'll have access to those strings/integers. Not actually setting host/game dvars on clients. I figured to call it SetClientDvar because it was saving data for the client.

you called it "SetClientDvar" so people would view the thread #ClickBait :troll:

The following 2 users say thank you to oCmKs_4_LiFe for this useful post:

HiddenHour, Im_YouViolateMe
05-10-2016, 03:25 PM #14
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by LiFe View Post
you called it "SetClientDvar" so people would view the thread #ClickBait :troll:


Shhhhh, edit your reply pls tears

The following 2 users say thank you to Im_YouViolateMe for this useful post:

HiddenHour, oCmKs_4_LiFe

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo