Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default get5.cfg + return of default splewis get5 pause system #6

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions get5.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
// This file was auto-generated by SourceMod (v1.10.0.6455)
// ConVars for plugin "get5.smx"
// Don't forget to place this in csgo\cfg\sourcemod

// Whether or not technical pauses are allowed
// -
// Default: "1"
get5_allow_technical_pause "0"

// Name of a match config file to automatically load when the server loads
// -
// Default: ""
get5_autoload_config ""

// Whether the get5 backup system is enabled
// -
// Default: "1"
get5_backup_system_enabled "0"

// If set to 0, get5 will not force players to the correct team based on steamid
// -
// Default: "1"
get5_check_auths "1"

// Format of the damage output string. Avaliable tags are in the default, color tags such as {LIGHT_RED} and {GREEN} also work.
// -
// Default: "--> ({DMG_TO} dmg / {HITS_TO} hits) to ({DMG_FROM} dmg / {HITS_FROM} hits) from {NAME} ({HEALTH} HP)"
get5_damageprint_format "--> ({DMG_TO} dmg / {HITS_TO} hits) to ({DMG_FROM} dmg / {HITS_FROM} hits) from {NAME} ({HEALTH} HP)"

// Format for demo file names, use "" to disable
// -
// Default: "{MATCHID}_map{MAPNUMBER}_{MAPNAME}"
get5_demo_name_format "{MATCHID}_map{MAPNUMBER}_{MAPNAME}"

// Whether to wait for map vetos to be printed to GOTV before changing map
// -
// Default: "0"
get5_display_gotv_veto "0"

// Whether to end the match if all players disconnect before ending. No winner is set if this happens.
// -
// Default: "0"
get5_end_match_on_empty_server "1"

// Path to use when writing match event logs, use "" to disable
// -
// Default: ""
get5_event_log_format ""

// If set to non-zero, this will be the fixed length of any pause
// -
// Default: "0"
get5_fixed_pause_time "60"

// Template that the server hostname will follow when a match is live. Leave field blank to disable. Valid parameters are: {MAPNUMBER}, {MATCHID}, {SERVERID}, {MAPNAME}, {TIME}, {TEAM1}, {TEAM2}
// -
// Default: "Get5: {TEAM1} vs {TEAM2}"
get5_hostname_format "CSGO League: {TEAM1} vs {TEAM2}"

// Whether or not admins with the changemap flag will be immune to kicks from "get5_kick_when_no_match_loaded". Set to "0" to disable
// -
// Default: "1"
get5_kick_immunity "1"

// Whether the plugin kicks new clients when no match is loaded
// -
// Default: "1"
get5_kick_when_no_match_loaded "1"

// Config file to exec when the game goes live
// -
// Default: "get5/live.cfg"
get5_live_cfg "get5/live.cfg"

// Number of seconds used to count down when a match is going live
// -
// Default: "10"
// Minimum: "5.000000"
// Maximum: "60.000000"
get5_live_countdown_time "5"

// Number of seconds before a backup file is automatically deleted, 0 to disable
// -
// Default: "160000"
get5_max_backup_age "160000"

// Maximum number of time the game can spend paused by a team, 0=unlimited
// -
// Default: "300"
get5_max_pause_time "300"

// Maximum number of pauses a team can use, 0=unlimited
// -
// Default: "0"
get5_max_pauses "1"

// The tag applied before plugin messages.
// -
// Default: "[{YELLOW}Get5{NORMAL}]"
get5_message_prefix "[{YELLOW}CSGO League{NORMAL}]"

// Whether pausing is allowed.
// -
// Default: "1"
get5_pausing_enabled "1"

// Whether damage reports are printed on round end.
// -
// Default: "0"
get5_print_damage "1"

// Whether pause limits will be reset each halftime period
// -
// Default: "1"
get5_reset_pauses_each_half "1"

// Integer that identifies your server. This is used in temp files to prevent collisions.
// -
// Default: "0"
get5_server_id "0"

// Whether to set client clan tags to player ready status.
// -
// Default: "1"
get5_set_client_clan_tags "1"

// Where match stats are saved (updated each map end), set to "" to disable
// -
// Default: "get5_matchstats_{MATCHID}.cfg"
get5_stats_path_format "get5_matchstats_{MATCHID}.cfg"

// Whether clients can use the !stop command to restore to the last round
// -
// Default: "1"
get5_stop_command_enabled "0"

// Time format to use when creating file names. Don't tweak this unless you know what you're doing! Avoid using spaces or colons.
// -
// Default: "%Y-%m-%d_%H"
get5_time_format "%Y-%m-%d_%H"

// Time (in seconds) a team has to make a !stay/!swap decision after winning knife round, 0=unlimited
// -
// Default: "60"
get5_time_to_make_knife_decision "30"

// Time (in seconds) teams have to ready up before forfeiting the match, 0=unlimited
// -
// Default: "0"
get5_time_to_start "300"

// Time (in seconds) from presenting a veto menu to a selection being made, during which a confirmation will be required, 0 to disable
// -
// Default: "2.0"
get5_veto_confirmation_time "2.0"

// Seconds to countdown before veto process commences. Set to "0" to disable.
// -
// Default: "5"
get5_veto_countdown "5"

// Config file to exec in warmup periods
// -
// Default: "get5/warmup.cfg"
get5_warmup_cfg "get5/warmup.cfg"


96 changes: 70 additions & 26 deletions scripting/get5/pausing.sp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,66 @@ public Action Command_Pause(int client, int args) {
return Plugin_Handled;
}

FakeClientCommandEx(client,"callvote StartTimeout");
g_InExtendedPause = false;

if (client == 0) {
g_InExtendedPause = true;

Pause();
Get5_MessageToAll("%t", "AdminForcePauseInfoMessage");
return Plugin_Handled;
}

MatchTeam team = GetClientMatchTeam(client);
int maxPauses = g_MaxPausesCvar.IntValue;
char pausePeriodString[32];
if (g_ResetPausesEachHalfCvar.BoolValue) {
Format(pausePeriodString, sizeof(pausePeriodString), " %t", "PausePeriodSuffix");
}

if (maxPauses > 0 && g_TeamPausesUsed[team] >= maxPauses && IsPlayerTeam(team)) {
Get5_Message(client, "%t", "MaxPausesUsedInfoMessage", maxPauses, pausePeriodString);
return Plugin_Handled;
}

int maxPauseTime = g_MaxPauseTimeCvar.IntValue;
if (maxPauseTime > 0 && g_TeamPauseTimeUsed[team] >= maxPauseTime && IsPlayerTeam(team)) {
Get5_Message(client, "%t", "MaxPausesTimeUsedInfoMessage", maxPauseTime, pausePeriodString);
return Plugin_Handled;
}

g_TeamReadyForUnpause[MatchTeam_Team1] = false;
g_TeamReadyForUnpause[MatchTeam_Team2] = false;

// If the pause will need explicit resuming, we will create a timer to poll the pause status.
bool need_resume = Pause(g_FixedPauseTimeCvar.IntValue, MatchTeamToCSTeam(team));
if (IsPlayer(client)) {
Get5_MessageToAll("%t", "MatchPausedByTeamMessage", client);
}

if (IsPlayerTeam(team)) {
if (need_resume) {
CreateTimer(1.0, Timer_PauseTimeCheck, team, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}

g_TeamPausesUsed[team]++;

pausePeriodString = "";
if (g_ResetPausesEachHalfCvar.BoolValue) {
Format(pausePeriodString, sizeof(pausePeriodString), " %t", "PausePeriodSuffix");
}

if (g_MaxPausesCvar.IntValue > 0) {
int pausesLeft = g_MaxPausesCvar.IntValue - g_TeamPausesUsed[team];
if (pausesLeft == 1 && g_MaxPausesCvar.IntValue > 0) {
Get5_MessageToAll("%t", "OnePauseLeftInfoMessage", g_FormattedTeamNames[team], pausesLeft,
pausePeriodString);
} else if (g_MaxPausesCvar.IntValue > 0) {
Get5_MessageToAll("%t", "PausesLeftInfoMessage", g_FormattedTeamNames[team], pausesLeft,
pausePeriodString);
}
}
}

return Plugin_Handled;
}
Expand Down Expand Up @@ -89,33 +148,18 @@ public Action Command_Unpause(int client, int args) {
MatchTeam team = GetClientMatchTeam(client);
g_TeamReadyForUnpause[team] = true;

if (!g_InExtendedPause)
{
if (g_TeamReadyForUnpause[MatchTeam_Team1] && g_TeamReadyForUnpause[MatchTeam_Team2]) {
Unpause();
if (IsPlayer(client)) {
Get5_MessageToAll("%t", "MatchUnpauseInfoMessage", client);
}
g_TeamReadyForUnpause[MatchTeam_Team1] = false;
g_TeamReadyForUnpause[MatchTeam_Team2] = false;
} else if (g_TeamReadyForUnpause[MatchTeam_Team1] && !g_TeamReadyForUnpause[MatchTeam_Team2]) {
Get5_MessageToAll("%t", "WaitingForUnpauseInfoMessage", g_FormattedTeamNames[MatchTeam_Team1],
g_FormattedTeamNames[MatchTeam_Team2]);
} else if (!g_TeamReadyForUnpause[MatchTeam_Team1] && g_TeamReadyForUnpause[MatchTeam_Team2]) {
Get5_MessageToAll("%t", "WaitingForUnpauseInfoMessage", g_FormattedTeamNames[MatchTeam_Team2],
g_FormattedTeamNames[MatchTeam_Team1]);
if (g_TeamReadyForUnpause[MatchTeam_Team1] && g_TeamReadyForUnpause[MatchTeam_Team2]) {
Unpause();
if (IsPlayer(client)) {
Get5_MessageToAll("%t", "MatchUnpauseInfoMessage", client);
}
} else if (g_TeamReadyForUnpause[MatchTeam_Team1] && !g_TeamReadyForUnpause[MatchTeam_Team2]) {
Get5_MessageToAll("%t", "WaitingForUnpauseInfoMessage", g_FormattedTeamNames[MatchTeam_Team1],
g_FormattedTeamNames[MatchTeam_Team2]);
} else if (!g_TeamReadyForUnpause[MatchTeam_Team1] && g_TeamReadyForUnpause[MatchTeam_Team2]) {
Get5_MessageToAll("%t", "WaitingForUnpauseInfoMessage", g_FormattedTeamNames[MatchTeam_Team2],
g_FormattedTeamNames[MatchTeam_Team1]);
}
else
{
if (client == 0)
{
Unpause();
Get5_MessageToAll("%t", "AdminForceUnPauseInfoMessage");
return Plugin_Handled;
}
}


return Plugin_Handled;
}