+ Reply to Thread
Results 1 to 6 of 6

Thread: Hud: sv_location

  1. #1
    *outburst_
    Guest

    Post Hud: sv_location

    I want my hud to show what server i'm playing on.
    I can do it for any server, except russian. The problem is: sv_location shows cvar "RU #2", and
    Code:
    cvarTest sv_location
    showCvar {"RU #2"}
    doesn't work.

    Any ideas?

  2. #2
    Senior Member namad will become famous soon enough namad's Avatar
    Join Date
    Aug 2010
    Location
    Ukraine, Kiev
    Posts
    402
    Actually, the variable is sv_location and "RU #2" - is it's value. Did you try cvar "sv_location"?

  3. #3
    Senior Member Lorfa has a spectacular aura about Lorfa has a spectacular aura about Lorfa has a spectacular aura about Lorfa's Avatar
    Join Date
    Aug 2010
    Location
    Kepler-22b
    Posts
    7,877
    Do any of the other servers have the # sign in the name?

    Can you also paste the part where it actually outputs this info to the screen?

  4. #4
    Junior Member DSTEKER is on a distinguished road DSTEKER's Avatar
    Join Date
    Oct 2010
    Location
    Russia, Smolensk
    Posts
    10
    Code:
    itemDef { 
    	name "Location"
    	rect 0 34 72 20 
    	textscale .18 
    	forecolor 1 1 1 1 
    	visible 1 
    	type ITEM_TYPE_NUMERICFIELD 
    	text "Location:" 
    	cvar "sv_location"
    	cvarTest "sv_location" 	
    	ownerdrawflag CG_SHOW_IF_WARMUP
            }

  5. #5
    *outburst_
    Guest
    Quote Originally Posted by Lorfa View Post
    Do any of the other servers have the # sign in the name?

    Can you also paste the part where it actually outputs this info to the screen?
    No, other servers neither have # in their names, nor the space.

    Code:
    itemDef {
    		name "srvLocationRU"
    		rect 5 30 25 50
    		visible 1
    		textstyle 3 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Russia"
    		cvarTest sv_location
    		showCvar {"RU #2"}
    	}
    Quote Originally Posted by DSTEKER View Post
    Code:
    itemDef { 
    	name "Location"
    	rect 0 34 72 20 
    	textscale .18 
    	forecolor 1 1 1 1 
    	visible 1 
    	type ITEM_TYPE_NUMERICFIELD 
    	text "Location:" 
    	cvar "sv_location"
    	cvarTest "sv_location" 	
    	ownerdrawflag CG_SHOW_IF_WARMUP
            }
    This shows "RU #", when serverinfo shows "RU #2" o_O
    But even "RU #" doesn't work.

    Well, sometimes it works, sometimes not, sometimes it flashes...
    I'll post the whole thing in the next post so you can try it yourselves..
    Last edited by outburst_; 02-26-2013 at 05:09 AM.

  6. #6
    *outburst_
    Guest
    Code:
    menudef{
    	name "warmUp"
    	fullScreen MENU_FALSE
    	visible 1
    	ownerdrawflag CG_SHOW_IF_WARMUP
    	rect 5 425 150 60
    	
    	itemdef{
    		name "infosBackground"
    		rect -175 -15 350 65
    		style 2
    		visible 1		
    		backcolor 0 0 0 1
    	}	
    
        itemDef {
            name "gametype"
            rect 108 8 40 40
            visible 1
            ownerdraw CG_GAME_TYPE_ICON
        }
    
    	itemDef {
    		name "localTime"
    		rect 5 15 50 50
    		ownerdraw CG_LOCALTIME
    		textscale 0.25
    		textstyle 3
    		style WINDOW_STYLE_FILLED
    		decoration
    		visible 1
    	}
    	
    	itemDef {
    		name "warmupInfo"
    		rect 5 0 25 50 
    		visible 1
    		textstyle 3 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "^4Warmup ^4Info"
    	}
    
    	// Display Server location + flag
    	itemDef {
    		name "srvLocationRU"
    		rect 5 30 25 50
    		visible 1
    		textstyle 3 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Russia"
    		cvarTest sv_location
    		showCvar {"RU #"}
    	}
    
    	itemDef {
    		name "srvLocationDE"
    		rect 5 30 25 50 
    		visible 1
    		textstyle 2 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Germany"
    		cvarTest sv_location
    		showCvar {"DE"}
    	}
    
    
    	itemDef {
    		name "srvLocationSE"
    		rect 5 30 25 50 
    		visible 1
    		textstyle 2 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Sweden"
    		cvarTest sv_location
    		showCvar {"SE"}
    	}
    
    	itemDef {
    		name "srvLocationNL"
    		rect 5 30 25 50 
    		visible 1
    		textstyle 2 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Netherlands"
    		cvarTest sv_location
    		showCvar {"NL"}
    	}
    
    	itemDef {
    		name "srvLocationOther"
    		rect 5 30 25 50 
    		visible 1
    		textstyle 2 
    		textscale 0.25 
    		forecolor 1 1 1 1 
    		text "Other"
    		cvarTest sv_location
    		hideCvar {"RU #"; "DE"; "SE"; "NL"}
    	}
    
        itemDef {
            name "srvFlagRU"
            rect 62 16 28 20
            visible 1
            style 3
            background "ui/assets/flags/ru.tga"
    		cvarTest sv_location
    		showCvar {"RU #";}
        }
    	
        itemDef {
            name "srvFlagDE"
            rect 72 16 28 20
            visible 1
            style 3
            background "ui/assets/flags/de.tga"
    		cvarTest sv_location
    		showCvar {"DE"}
        }
    	
        itemDef {
            name "srvFlagSE"
            rect 72 16 28 20
            visible 1
            style 3
            background "ui/assets/flags/se.tga"
    		cvarTest sv_location
    		showCvar {"SE"}
        }
    	
        itemDef {
            name "srvFlagNL"
            rect 85 16 28 20
            visible 1
            style 3
            background "ui/assets/flags/nl.tga"
    		cvarTest sv_location
    		showCvar {"NL"}
        }
    	
        itemDef {
            name "srvFlagOther"
            rect 72 16 28 20
            visible 1
            style 3
            background "ui/assets/flags/none.tga"
    		cvarTest sv_location
    		hideCvar {"RU #"; "DE"; "SE"; "NL"}
        }
    	
    	itemDef { 
    	name "Location"
    	rect 0 44 72 20 
    	textscale .18 
    	forecolor 1 1 1 1 
    	visible 1 
    	type ITEM_TYPE_NUMERICFIELD 
    	text "Loc:" 
    	cvar "sv_location"
    	cvarTest "sv_location" 	
    	ownerdrawflag CG_SHOW_IF_WARMUP
            }
    }
    So it works on any server (de, nl, swe), but not on ru

+ Reply to Thread

Tags for this Thread

Posting Permissions

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