PDA

View Full Version : Showing values in .menu files



pollo
9th May 2016, 15:35
Hi guys

My question is, how can I show values in a .menu file? (at quickmessages)

Today I've been working on storing stats and stuff in different .txt files and it works, but I want to show those stats in a .menu file, specifically inside quickmessage menu. But as I just know the basics about menu modding, I have no clue of how to go on with this. I've made the menu, the localized strings and all that, I just need to put the individual stats in there.

Help? I'll provide code if you need it

Ty

voron00
9th May 2016, 15:59
self setClientCvar("ui_stats_kills", self.kills);

And then use this cvar in your menus, just look how its done in serverinfo menus ( I would have given you an example code but i only will be home tomorrow ).

IzNoGoD
9th May 2016, 20:40
Replace the text part of an itemdef with cvar/dvar (not sure which one, try both), with value [the dvar you want to show], like:


dvar cl_showthisdvarplox

pollo
9th May 2016, 21:48
self setClientCvar("ui_stats_kills", self.kills);

And then use this cvar in your menus, just look how its done in serverinfo menus ( I would have given you an example code but i only will be home tomorrow ).


Replace the text part of an itemdef with cvar/dvar (not sure which one, try both), with value [the dvar you want to show], like:


dvar cl_showthisdvarplox


It works! :)

I set various itemDefs with various dvars and then used those dvars in the setclientcvar func


itemDef
{
name "stats_headshots"
group ingamebox
visible 1
rect 60 68 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
dvar "ui_stats_headshots"
forecolor 0 1 0 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
decoration
}

and in .gsc, as you guys said:


self setclientcvar("ui_stats_headshots", headshots)

Thanks a lot!! :)