Add translation for !extend & update m_iRoundTime | Feat/extensionqol (#1172)

* Add extension translation

* Set currents coreboard roundtime
This commit is contained in:
Isaac Boaz 2022-09-15 04:33:51 -07:00 committed by GitHub
parent a1a1c6adfa
commit f4cd4e9e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -69,12 +69,15 @@ bool gB_BlockRoundEndEvent = false;
bool gB_AlternateZeroPrint = false;
Handle gH_Timer = null;
EngineVersion gEV_Type = Engine_Unknown;
chatstrings_t gS_ChatStrings;
Handle gH_Forwards_OnCountdownStart = null;
// table prefix
char gS_MySQLPrefix[32];
bool gB_Late = false;
public Plugin myinfo =
{
name = "[shavit] Dynamic Timelimits",
@ -84,6 +87,12 @@ public Plugin myinfo =
url = "https://github.com/shavitush/bhoptimer"
}
public APLRes AskPluginLoad2(Handle plugin, bool late, char[] error, int maxlength)
{
gB_Late = late;
return APLRes_Success;
}
public void OnPluginStart()
{
gEV_Type = GetEngineVersion();
@ -132,6 +141,9 @@ public void OnPluginStart()
GetTimerSQLPrefix(gS_MySQLPrefix, 32);
gH_SQL = GetTimerDatabaseHandle();
if(gB_Late)
Shavit_OnChatConfigLoaded();
}
public void OnMapStart()
@ -209,6 +221,11 @@ public void OnConfigsExecuted()
}
}
public void Shavit_OnChatConfigLoaded()
{
Shavit_GetChatStringsStruct(gS_ChatStrings);
}
void StartCalculating()
{
char sMap[PLATFORM_MAX_PATH];
@ -292,6 +309,7 @@ void SetLimit(int time)
if(mp_roundtime != null)
{
mp_roundtime.IntValue = time;
GameRules_SetProp("m_iRoundTime", time * 60);
}
}
@ -454,7 +472,6 @@ public Action Command_Extend(int client, int args)
}
ExtendMapTimeLimit(extendtime);
Shavit_PrintToChatAll("%N extended the map by %d minutes", client, extendtime / 60);
Shavit_PrintToChatAll("%T", "Extended", LANG_SERVER, gS_ChatStrings.sVariable2, client, gS_ChatStrings.sText, gS_ChatStrings.sVariable, extendtime / 60, gS_ChatStrings.sText);
return Plugin_Handled;
}

View File

@ -51,6 +51,11 @@
"#format" "{1:s}"
"en" "{1} seconds remaining."
}
"Extended"
{
"#format" "{1:s},{2:N},{3:s},{4:s},{5:d},{6:s}"
"en" "{1}{2}{3} extended the map by {4}{5}{6} minutes."
}
// ----------- Random ----------- //
"TimerLoading"
{