Post: [RELEASE] setClientDvar
06-28-2013, 02:00 AM #1
Source Code
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys, this is a small release but its my best effort at remaking the original GSC function. All you need is to add the offset for the dvar you want to use. After that just use one of the three functions to set its value. For example, client fov is located at 0x018D53D4 as of the 1.24 update. So i added that offset into my dvars class.


Also, you don't need to worry about converting the value into an array of bytes. The functions automatically do it for you. you just have to tell the program what type of value you're using by calling either setBoolDvar, setFloatDvar, or setIntDvar.



Be sure to have this.


    public static void SetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
}







Make sure to initialize this class. This is where all of your dvar offsets go.


    public class dvars 
{

//DVAR Offsets Go here

public static uint
cg_fov = 0x018D53D4; //float var

}








setDvar Functions.

    private void setIntDvar(uint dvar, int input) 
{
byte[] INT = BitConverter.GetBytes(input);
Array.Reverse(INT);
SetMemory(dvar, INT);
}

private void setFloatDvar(uint dvar, float input)
{
byte[] FLT = BitConverter.GetBytes(input);
Array.Reverse(FLT);
SetMemory(dvar, FLT);
}

private void setBoolDvar(uint dvar, bool input)
{
byte[] BOL = BitConverter.GetBytes(input);
Array.Reverse(BOL);
SetMemory(dvar, BOL);
}





Here's an example of setting a float dvar:


    private void exampleFunction() 
{

setFloatDvar(dvars.cg_fov, 90);

}

The following 4 users say thank you to Source Code for this useful post:

Chxii, FutureOps, Mango_Knife, THE-KILLERZ07

The following user groaned Source Code for this awful post:

ZerOtObey+RM

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo