fix ExtendHumiliation.sp

This commit is contained in:
Robin Appelman 2026-07-10 22:49:39 +02:00
commit 1c0884386c

View file

@ -8,12 +8,12 @@ public Plugin:myinfo =
} }
new Handle:gBonusRoundTime = INVALID_HANDLE; new Handle:gBonusRoundTime = INVALID_HANDLE;
new Int:bonustime = 0; int bonustime = 0;
ConVar g_cvTime; ConVar g_cvTime;
public OnPluginStart() { public void OnPluginStart() {
CreateTimer(1.0, UpdateCvar, _, TIMER_REPEAT); CreateTimer(1.0, UpdateCvar, _, TIMER_REPEAT);
gBonusRoundTime = FindConVar("mp_bonusroundtime"); gBonusRoundTime = FindConVar("mp_bonusroundtime");
g_cvTime = CreateConVar("bonus_time", "15", "The length of bonus round time"); g_cvTime = CreateConVar("bonus_time", "15", "The length of bonus round time");
@ -29,12 +29,14 @@ public OnPluginStart() {
//somehow tell sourcemod the plugin has crashed. //somehow tell sourcemod the plugin has crashed.
} }
} }
public Action UpdateCvar(Handle timer)
{ public Action UpdateCvar(Handle timer) {
bonustime = g_cvTime.IntValue; bonustime = g_cvTime.IntValue;
if (gBonusRoundTime != INVALID_HANDLE) if (gBonusRoundTime != INVALID_HANDLE)
{ {
SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue); SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue);
ServerCommand("mp_bonusroundtime %d", bonustime); ServerCommand("mp_bonusroundtime %d", bonustime);
} }
}
return Plugin_Continue;
}