ItsMods
[Tutorial] getting a clientdvar - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Tutorial] getting a clientdvar (/Thread-Tutorial-getting-a-clientdvar.html)

Pages: 1 2


getting a clientdvar - Pozzuh - 08-06-2011

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:
Code:
{ menuDef { name "clientdvar" rect 0 0 1 1 fullscreen 0 visible 0 onOpen { scriptMenuResponse "(dvarString((dvarstring(getting_dvar))))"; close self; } onEsc{} } }
3. Precache the menu in your gsc file (paste this in init())
Code:
game["menu_clientdvar"] = "clientdvar"; precachemenu(game["menu_clientdvar"]);
4. Now use the function as
Code:
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.


RE: getting a clientdvar - Scripts18 - 08-06-2011

Thx alot, needed taht for my fat mod


RE: getting a clientdvar - Bloopbloop - 08-07-2011

Fine here's your reply pozzuh.


RE: getting a clientdvar - Yamato - 08-07-2011

Nyan Cat says Nice, Big Grin


RE: getting a clientdvar - Nekochan - 08-07-2011

Nyan Cat, nice .


RE: getting a clientdvar - iAegle - 08-12-2011

but but but but but, You told me not to share this..


RE: getting a clientdvar - Pozzuh - 08-12-2011

well I changed my mind

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


RE: getting a clientdvar - iAegle - 08-12-2011

(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 ;(


RE: getting a clientdvar - Pozzuh - 08-12-2011

(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


RE: getting a clientdvar - iAegle - 08-12-2011

(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