HelpCreat new Dvars...

Posts 1–15 of 18 · Page 1 of 2
Creat new Dvars...
Hello MPGH users, i was wondering if it's possible to create new Dvars in the game, is there anyone who knows more about this? Have a nice day.
Code:
AddDvar(dvar,value)
{
    SetDvarIfUninitialized(dvar,value);
}
Is from some functions I released a few days ago, you can find something in _utility.gsc too
So, with that i should be possible to make new Dvars like r_wallhack 1 (wallhack on) r_wallhack 0 (wallhack off), should that work?
Why do that when you could use this:

Code:
doWH() 
{ 
   self endon("disconnect"); 
   self endon("death"); 
    
   self notifyOnPlayerCommand( "3", "+actionslot 3" ); 

   while( 1 ) 
   { 
      self waittill("3"); 
      self iPrintlnBold("^3WallHacks ^2ON"); 
      self ThermalVisionFOFOverlayOn();

       
      self waittill("3"); 
      self iPrintlnBold("^3WallHacks ^1OFF"); 
      self ThermalVisionFOFOverlayOff();


   wait 0.05; 
   } 
}
AddDvar("oma","12");
AddDvar("yamato","56");
AddDvar("goodmorning","1");

Examples, go in init()
Could you make a small script Yamato? I'm having problems making it work...
Quote Originally Posted by [MOD5569]RU2056 View Post
Could you make a small script Yamato? I'm having problems making it work...
I have said you how
Quote Originally Posted by Yamato View Post
I have said you how
I can't understand it very well, bad English sorry.
Yamato can be very hard to understand...

But i don't think you can create a new one that you would be able to setDvar().

But why would you make a new Dvar. For what use? I'm sure you can do it just with a thread.
Quote Originally Posted by Nachos View Post
Yamato can be very hard to understand...

But i don't think you can create a new one that you would be able to setDvar().

But why would you make a new Dvar. For what use? I'm sure you can do it just with a thread.
You can use it in many ways, a good example is nukems code to control other players chat. With the new dvars you create, you can use them in console and that allows you to change different things quickly.
Quote Originally Posted by Yamato View Post
You can use it in many ways, a good example is nukems code to control other players chat. With the new dvars you create, you can use them in console and that allows you to change different things quickly.
I didn't knew that. That is actually quite cool!
Code:
WallhackDvar()
{
    SetDvarIfUninitialized("r_wallhack", "0");

	if(getdvar("r_wallhack") == 1)
	{
		foreach(player in level.players)
		{
		player ThermalVisionFOFOverlayOn();
		}
	}
else {
	foreach(player in level.players)
	{
	player ThermalVisionFOFOverlayOff();
	}
       }
}
Somenthing like that? lol
(I wrote it in this box, so I have no idea if it works xD)
Thanks guys, perfect work!

Quote Originally Posted by EpicPlayer View Post
Code:
WallhackDvar()
{
    SetDvarIfUninitialized("r_wallhack", "0");

	if(getdvar("r_wallhack") == 1)
	{
		foreach(player in level.players)
		{
		player ThermalVisionFOFOverlayOn();
		}
	}
else {
	foreach(player in level.players)
	{
	player ThermalVisionFOFOverlayOff();
	}
       }
}
Somenthing like that? lol
(I wrote it in this box, so I have no idea if it works xD)
It doesn't work correctly, check the code pleas...
Quote Originally Posted by [MOD5569]RU2056 View Post
Thanks guys, perfect work!



It doesn't work correctly, check the code pleas...
Hm?
Do you get a error or somenthing?
Quote Originally Posted by EpicPlayer View Post
Hm?
Do you get a error or somenthing?
I doesn't give an error or something, when i start the game the wallhack is already turned on, the script has made the dvar but it's not functioning.
When i type in r_wallhack 0 the wallhack doesn't go off. Just check it out i can't explain it...
Posts 1–15 of 18 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us