AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [L4D2] HUD Server Logo (https://forums.alliedmods.net/showthread.php?t=302730)

Marttt 07-22-2021 15:38

Re: [L4D2] HUD Server Logo
 
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.

KoMiKoZa 07-23-2021 13:00

Re: [L4D2] HUD Server Logo
 
Quote:

Originally Posted by Marttt (Post 2753396)
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.

Marttt 07-25-2021 11:26

Re: [L4D2] HUD Server Logo
 
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.

GoGetSomeSleep 08-01-2022 15:40

Re: [L4D2] HUD Server Logo
 
any example for get hostname and add to hud line?

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

Marttt 08-02-2022 07:42

Re: [L4D2] HUD Server Logo
 
Probably something like this:

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

GoGetSomeSleep 08-02-2022 11:34

Re: [L4D2] HUD Server Logo
 
Quote:

Originally Posted by Marttt (Post 2785409)
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 )



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

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