Raised This Month: $12 Target: $400
 3% 

[L4D2] HUD Server Logo


Post New Thread Reply   
 
Thread Tools Display Modes
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-22-2021 , 15:38   Re: [L4D2] HUD Server Logo
Reply With Quote #11

You could try reading this part on the docs:

https://developer.valvesoftware.com/.../Appendix:_HUD

PHP Code:
      supply   = { slot HUD_RIGHT_TOPstaticstring "Supplies: "datafunc = @() g_MapScript.Resources.CurrentCountname "supply" 
But I don't know how to track the "restart" count in VScript.

Is possible to use my [L4D2] Scripted HUD plugin to achieve that through SM.

Although it has some limitations, I know that on SM1.11 they are adding more support to some stuff that EMS script needs so probably in some months that could be improved.
__________________

Last edited by Marttt; 07-22-2021 at 15:44.
Marttt is offline
KoMiKoZa
Senior Member
Join Date: Dec 2017
Location: Thy old times.
Old 07-23-2021 , 13:00   Re: [L4D2] HUD Server Logo
Reply With Quote #12

Quote:
Originally Posted by Marttt View Post
Is possible to use my [L4D2] Scripted HUD plugin to achieve that through SM.

Although it has some limitations, I know that on SM1.11 they are adding more support to some stuff that EMS script needs so probably in some months that could be improved.
Thanks for the reply.

I was actually thinking about using your addon instead since there's nothing that interferes with the .nut gamemode files on my server.

How would one go about tracking restarts through this plugin and SM though? I'm clueless either way.

UPD: Thanks to Marttt for the replies and pointers. I'm afraid I'm absolutely clueless about scripting, so I'll try to post this in plugin requests.

Last edited by KoMiKoZa; 07-26-2021 at 06:32.
KoMiKoZa is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-25-2021 , 11:26   Re: [L4D2] HUD Server Logo
Reply With Quote #13

There are several ways, if is a coop game you can get the number of rounds with this

PHP Code:
    int entity FindEntityByClassname(-1"terror_player_manager");

    if (
entity != -1)
    {
        
int missionWipes GetEntProp(entityProp_Send"m_missionWipes");
        
PrintToChatAll("missionWipes %i"missionWipes);
    } 
You could also track by hooking the round_start event I think.

Probably is possible to get it through vscript aswell but I don't have the knowledge.

This kind of question is kinda unrelated to the OP topic so maybe its better to ask in the scripting area.
__________________

Last edited by Marttt; 07-25-2021 at 23:02.
Marttt is offline
GoGetSomeSleep
Senior Member
Join Date: Dec 2018
Location: Miami/Florida
Old 08-01-2022 , 15:40   Re: [L4D2] HUD Server Logo
Reply With Quote #14

any example for get hostname and add to hud line?

there is Convars.GetStr("hostname") but idk

Last edited by GoGetSomeSleep; 08-01-2022 at 15:41.
GoGetSomeSleep is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-02-2022 , 07:42   Re: [L4D2] HUD Server Logo
Reply With Quote #15

Probably something like this:

local hostname = Convars.GetStr("hostname");
and use it inside the hud
__________________
Marttt is offline
GoGetSomeSleep
Senior Member
Join Date: Dec 2018
Location: Miami/Florida
Old 08-02-2022 , 11:34   Re: [L4D2] HUD Server Logo
Reply With Quote #16

Quote:
Originally Posted by Marttt View Post
Probably something like this:

local hostname = Convars.GetStr("hostname");
and use it inside the hud
like this?

Code:
local hostname = Convars.GetStr("hostname");

HUDTable <-
{
	Fields = 
	{
		hud = { slot = HUD_FAR_RIGHT, special = hostname, flags = HUD_FLAG_ALIGN_RIGHT, name = "host" }
	}
}


HUDSetLayout(HUDTable)
     HUDPlace( HUD_FAR_RIGHT, 0.0100, 0.0350, 0.0595, 0.075 )
or this

Code:
local hostname = Convars.GetStr("hostname");

HUDTable <-
{
	Fields = 
	{
	     hud   = { slot = HUD_RIGHT_TOP, hostname  = Convars.GetStr("hostname");, name = "HUD" }
	}
}


HUDSetLayout(HUDTable)
     HUDPlace( HUD_RIGHT_TOP, 0.0100, 0.0350, 0.0595, 0.075 )

Last edited by GoGetSomeSleep; 08-02-2022 at 11:37.
GoGetSomeSleep is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode