mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
Update shavit-timelimit.sp
This commit is contained in:
parent
b1a5339910
commit
35de5f5716
@ -49,6 +49,8 @@ ConVar mp_roundtime = null;
|
||||
Convar gCV_Config = null;
|
||||
Convar gCV_DefaultLimit = null;
|
||||
Convar gCV_DynamicTimelimits = null;
|
||||
Convar gCV_MinimumLimit = null;
|
||||
Convar gCV_MaximumLimit = null;
|
||||
Convar gCV_ForceMapEnd = null;
|
||||
Convar gCV_MinimumTimes = null;
|
||||
Convar gCV_PlayerAmount = null;
|
||||
@ -107,6 +109,8 @@ public void OnPluginStart()
|
||||
gCV_Config = new Convar("shavit_timelimit_config", "1", "Enables the following game settings:\n\"mp_do_warmup_period\" \"0\"\n\"mp_freezetime\" \"0\"\n\"mp_ignore_round_win_conditions\" \"1\"", 0, true, 0.0, true, 1.0);
|
||||
gCV_DefaultLimit = new Convar("shavit_timelimit_default", "60.0", "Default timelimit to use in case there isn't an average.", 0);
|
||||
gCV_DynamicTimelimits = new Convar("shavit_timelimit_dynamic", "1", "Use dynamic timelimits.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
||||
gCV_MinimumLimit = new Convar("shavit_timelimit_minimum", "20.0", "Minimum timelimit to use.\nREQUIRES \"shavit_timelimit_dynamic\" TO BE ENABLED!", 0);
|
||||
gCV_MaximumLimit = new Convar("shavit_timelimit_maximum", "120.0", "Maximum timelimit to use.\nREQUIRES \"shavit_timelimit_dynamic\" TO BE ENABLED!\n0 - No maximum", 0);
|
||||
gCV_ForceMapEnd = new Convar("shavit_timelimit_forcemapend", "1", "Force the map to end after the timelimit.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
||||
gCV_MinimumTimes = new Convar("shavit_timelimit_minimumtimes", "5", "Minimum amount of times required to calculate an average.\nREQUIRES \"shavit_timelimit_dynamic\" TO BE ENABLED!", 0, true, 5.0);
|
||||
gCV_PlayerAmount = new Convar("shavit_timelimit_playertime", "25", "Limited amount of times to grab from the database to calculate an average.\nREQUIRES \"shavit_timelimit_dynamic\" TO BE ENABLED!\nSet to 0 to have it \"unlimited\".", 0);
|
||||
@ -245,17 +249,17 @@ public void SQL_GetMapTimes(Database db, DBResultSet results, const char[] error
|
||||
|
||||
fAverage += 5; // I give extra 5 minutes, so players can actually retry the map until they get a good time.
|
||||
|
||||
if(fAverage < 20)
|
||||
if(fAverage < gCV_MinimumLimit.FloatValue)
|
||||
{
|
||||
fAverage = 20.0;
|
||||
fAverage = gCV_MinimumLimit.FloatValue;
|
||||
}
|
||||
|
||||
else if(fAverage > 120)
|
||||
else if(fAverage > gCV_MaximumLimit.FloatValue)
|
||||
{
|
||||
fAverage = 120.0;
|
||||
fAverage = gCV_MaximumLimit.FloatValue;
|
||||
}
|
||||
|
||||
SetLimit(RoundToNearest(fAverage));
|
||||
SetLimit(RoundToCeil(fAverage / 10) * 10);
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user