Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial getting a clientdvar
#1
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.
[Image: MaEIQ.png]
Reply

#2
Thx alot, needed taht for my fat mod
Reply

#3
Fine here's your reply pozzuh.
Reply

#4
Nyan Cat says Nice, Big Grin
Reply

#5
Nyan Cat, nice .
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#6
but but but but but, You told me not to share this..
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#7
well I changed my mind

I wanted to make sure there weren't any exploits possible, like in other cods.
[Image: MaEIQ.png]
Reply

#8
(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-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#9
(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
[Image: MaEIQ.png]
Reply

#10
(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
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  read out clientdvar? milchshake 3 2,498 03-02-2012, 17:43
Last Post: milchshake

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.