diff --git a/HostnameManager/scripting/HostnameManager.sp b/HostnameManager/scripting/HostnameManager.sp index 492eb07..07a7397 100644 --- a/HostnameManager/scripting/HostnameManager.sp +++ b/HostnameManager/scripting/HostnameManager.sp @@ -34,7 +34,7 @@ public Plugin myinfo = public void OnPluginStart() { g_cvHostname = FindConVar("hostname"); - g_cvFormattedHostname = CreateConVar("sm_hostname_format", "{HH}UNLOZE | {GM} | NoSteam{SD}", "HH = HappyHour, , GM = GameMode, SD = StageDisplay"); + g_cvFormattedHostname = CreateConVar("sm_hostname_format", "{HH}UNLOZE | {GM} | LagCompensation | NoSteam{SD}", "HH = HappyHour, , GM = GameMode, SD = StageDisplay"); CreateTimer(60.0, TimerRepeat, INVALID_HANDLE, TIMER_REPEAT); @@ -135,6 +135,17 @@ public void RefreshHostname() else ReplaceString(sFormattedHostname, sizeof(sFormattedHostname), "{GM}", "Zombie Escape", true); + int iLength = strlen(sFormattedHostname); + if(iLength > 55) + { + if (g_bHHLoaded && HH_IsItHappyHour()) //first trim hh if hh + ReplaceString(sFormattedHostname, sizeof(sFormattedHostname), "[HappyHour] ", "", true); + } + + iLength = strlen(sFormattedHostname); + if(iLength > 55) //check if its still too long and trim LagCompensation + ReplaceString(sFormattedHostname, sizeof(sFormattedHostname), "LagCompensation | ", "", true); + g_cvHostname.SetString(sFormattedHostname, false, false); }