ItsMods

Full Version: getting a clientdvar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There always has been a setclientdvar() function, but never a getclientdvar() function. About 2 months ago I found a way to get client dvars. This is the tutorial.
It's actually pretty easy, because you will just use my script.

1. Paste this code somewhere in your gsc.
Code:
getClientdvar(dvar)
{
    self endon("disconnect");
    
    self setclientdvar("getting_dvar",dvar);
    self openmenu(game["menu_clientdvar"]);    
    
    for(;;)
    {
        self waittill("menuresponse", menu, response);
        
        if(menu==game["menu_clientdvar"])
        {
            return response;
        }
    }
}
2. Make a new file in ui_mp/scriptmenus, call it clientdvar.menu. Paste this in it:
C++ Code
  1. {
  2. menuDef
  3. {
  4. name "clientdvar"
  5. rect 0 0 1 1
  6. fullscreen 0
  7. visible 0
  8. onOpen
  9. {
  10. scriptMenuResponse "(dvarString((dvarstring(getting_dvar))))";
  11. close self;
  12. }
  13. onEsc{}
  14. }
  15. }

3. Precache the menu in your gsc file (paste this in init())
C++ Code
  1. game["menu_clientdvar"] = "clientdvar";
  2. precachemenu(game["menu_clientdvar"]);

4. Now use the function as
C++ Code
  1. self getclientdvar("com_maxfps");


note: Make sure to include the files in your .csv file. ( menufile,ui_mp/scriptmenus/clientdvar.menu & rawfile,maps/mp/gametypes/_yourgsc.gsc
note 2: This cannot be looped in a while loop, it would lag out the player because it uses a menu file.

If you use this make sure to give me, Pozzuh, credits.

Good luck.
Thx alot, needed taht for my fat mod
Fine here's your reply pozzuh.
Nyan Cat says Nice, Big Grin
Nyan Cat, nice .
but but but but but, You told me not to share this..
well I changed my mind

I wanted to make sure there weren't any exploits possible, like in other cods.
(08-12-2011, 11:24)Pozzuh Wrote: [ -> ]well I changed my mind

I wanted to make sure there weren't any exploits possible, like in other cods.

bullshit, you are just a repwhore ;(
(08-12-2011, 11:26)iAegle Wrote: [ -> ]
(08-12-2011, 11:24)Pozzuh Wrote: [ -> ]well I changed my mind

I wanted to make sure there weren't any exploits possible, like in other cods.

bullshit, you are just a repwhore ;(

I found it out, not you so I can repwhore all I want.

And yes i'm a repwhore and idc Smile
(08-12-2011, 11:46)Pozzuh Wrote: [ -> ]
(08-12-2011, 11:26)iAegle Wrote: [ -> ]
(08-12-2011, 11:24)Pozzuh Wrote: [ -> ]well I changed my mind

I wanted to make sure there weren't any exploits possible, like in other cods.

bullshit, you are just a repwhore ;(

I found it out, not you so I can repwhore all I want.

And yes i'm a repwhore and idc Smile

Well... If you didn't tell me not to release it, then I would have released it :o
Pages: 1 2