From 30e4b6b9dae848954a19246b64530da8e50467f8 Mon Sep 17 00:00:00 2001 From: BotoX Date: Thu, 2 Mar 2017 21:45:36 +0100 Subject: [PATCH] New plugin: RoundTime --- RoundTime/scripting/RoundTime.sp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 RoundTime/scripting/RoundTime.sp diff --git a/RoundTime/scripting/RoundTime.sp b/RoundTime/scripting/RoundTime.sp new file mode 100644 index 00000000..8b832037 --- /dev/null +++ b/RoundTime/scripting/RoundTime.sp @@ -0,0 +1,28 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include + +public Plugin myinfo = +{ + name = "RoundTime", + author = "BotoX", + description = "Change roundtime instantly and remove limit.", + version = "1.0", + url = "" +} + +ConVar g_CVar_mp_roundtime; + +public void OnPluginStart() +{ + g_CVar_mp_roundtime = FindConVar("mp_roundtime"); + g_CVar_mp_roundtime.SetBounds(ConVarBound_Upper, true, 546.0); // empirically determined + g_CVar_mp_roundtime.AddChangeHook(OnConVarChanged); +} + +public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue) +{ + GameRules_SetProp("m_iRoundTime", StringToInt(newValue) * 60); +}