Results 1 to 4 of 4

Thread: Showing values in .menu files

  1. #1
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts

    Showing values in .menu files

    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

  2. #2
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    PHP Code:
    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 ).
    sudo apt-get rekt

  3. The Following User Says Thank You to voron00 For This Useful Post:

    pollo (9th May 2016)

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    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:
    PHP Code:
    dvar cl_showthisdvarplox 
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. The Following User Says Thank You to IzNoGoD For This Useful Post:

    pollo (9th May 2016)

  6. #4
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    Quote Originally Posted by voron00 View Post
    PHP Code:
    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 ).
    Quote Originally Posted by IzNoGoD View Post
    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:
    PHP Code:
    dvar cl_showthisdvarplox 
    It works!

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

    PHP Code:
    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:

    PHP Code:
    self setclientcvar("ui_stats_headshots"headshots
    Thanks a lot!!
    Last edited by pollo; 9th May 2016 at 22:53.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •