mirror of
https://codeberg.org/spire/docker-comp-server.git
synced 2026-06-03 10:04:11 +02:00
add ExtendHumiliation.smx
This commit is contained in:
parent
48bb5f4405
commit
8a550ef88c
8 changed files with 163 additions and 1 deletions
40
ExtendHumiliation.sp
Normal file
40
ExtendHumiliation.sp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
public Plugin:myinfo =
|
||||
{
|
||||
name = "Bonus Round Time Extend",
|
||||
author = "Mr. Random",
|
||||
description = "Create cvars to extend bonusroundtime beyond 15 sec.",
|
||||
version = "1.0",
|
||||
url = ":("
|
||||
}
|
||||
|
||||
new Handle:gBonusRoundTime = INVALID_HANDLE;
|
||||
new Int:bonustime = 0;
|
||||
|
||||
ConVar g_cvTime;
|
||||
|
||||
|
||||
public OnPluginStart() {
|
||||
CreateTimer(1.0, UpdateCvar, _, TIMER_REPEAT);
|
||||
gBonusRoundTime = FindConVar("mp_bonusroundtime");
|
||||
g_cvTime = CreateConVar("bonus_time", "15", "The length of bonus round time");
|
||||
if (gBonusRoundTime != INVALID_HANDLE)
|
||||
{
|
||||
SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue);
|
||||
ServerCommand("sm_cvar","mp_bonusroundtime",g_cvTime.FloatValue);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintToServer("Cvar failed to be acquired");
|
||||
//somehow tell sourcemod the plugin has crashed.
|
||||
}
|
||||
}
|
||||
public Action UpdateCvar(Handle timer)
|
||||
{
|
||||
bonustime = g_cvTime.IntValue;
|
||||
if (gBonusRoundTime != INVALID_HANDLE)
|
||||
{
|
||||
SetConVarBounds(gBonusRoundTime, ConVarBound_Upper, true, g_cvTime.FloatValue);
|
||||
ServerCommand("mp_bonusroundtime %d", bonustime);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue