seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
seta hud_panel_centerprint_fontscale "1"
seta hud_panel_centerprint_fontscale_bold "1.4"
seta hud_panel_centerprint_time "3"
-seta hud_panel_centerprint_fade_in "0.2"
-seta hud_panel_centerprint_fade_out "0.5"
+seta hud_panel_centerprint_fade_in "0.15"
+seta hud_panel_centerprint_fade_out "0.15"
seta hud_panel_centerprint_fade_subsequent "1"
seta hud_panel_centerprint_fade_subsequent_passone "3"
seta hud_panel_centerprint_fade_subsequent_passone_minalpha "0.5"
bool autocvar_hud_panel_centerprint;
float autocvar_hud_panel_centerprint_align;
-float autocvar_hud_panel_centerprint_fade_in = 0.2;
-float autocvar_hud_panel_centerprint_fade_out = 0.5;
+float autocvar_hud_panel_centerprint_fade_in = 0.15;
+float autocvar_hud_panel_centerprint_fade_out = 0.15;
float autocvar_hud_panel_centerprint_fade_subsequent = 1;
float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3;
float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5;
MSG_ANNCE_NOTIF(NUM_GAMESTART_9, N___NEVER, "9", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
MSG_ANNCE_NOTIF(NUM_GAMESTART_10, N___NEVER, "10", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_1, N___NEVER, "1", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_2, N___NEVER, "2", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_3, N___NEVER, "3", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_4, N___NEVER, "4", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_5, N___NEVER, "5", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_6, N___NEVER, "6", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_7, N___NEVER, "7", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_8, N___NEVER, "8", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_9, N___NEVER, "9", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
- MSG_ANNCE_NOTIF(NUM_IDLE_10, N___NEVER, "10", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
-
MSG_ANNCE_NOTIF(NUM_KILL_1, N___NEVER, "1", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
MSG_ANNCE_NOTIF(NUM_KILL_2, N___NEVER, "2", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
MSG_ANNCE_NOTIF(NUM_KILL_3, N___NEVER, "3", CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
MSG_INFO_NOTIF(POWERUP_STRENGTH, N_CONSOLE, 1, 0, "s1", "s1", "strength", _("^BG%s^K1 picked up Strength"), "")
MSG_INFO_NOTIF(QUIT_DISCONNECT, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 disconnected"), "")
- MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for idling"), "")
- MSG_INFO_NOTIF(MOVETOSPEC_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was moved to spectator for idling"), "")
+ MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 1, "s1 f1", "", "", _("^BG%s^F3 was kicked after idling for %s seconds"), "")
+ MSG_INFO_NOTIF(MOVETOSPEC_IDLING, N_CHATCON, 1, 1, "s1 f1", "", "", _("^BG%s^F3 was moved to^BG spectators^F3 after idling for %s seconds"), "")
MSG_INFO_NOTIF(QUIT_KICK_SPECTATING, N_CONSOLE, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for excessive teamkilling"), "")
- MSG_INFO_NOTIF(QUIT_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "")
+ MSG_INFO_NOTIF(QUIT_SPECTATE, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 is now^BG spectating"), "")
MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "")
MSG_INFO_NOTIF(RACE_FAIL_RANKED, N_CONSOLE, 1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time", "race_newfail", _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "")
MSG_CENTER_NOTIF(DEATH_TEAMKILL_FRAGGED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^K1You were fragged by ^BG%s^K1, a team mate"), _("^K1You were scored against by ^BG%s^K1, a team mate"))
MSG_CENTER_NOTIF(DISCONNECT_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGDisconnecting in ^COUNT..."), "")
- MSG_CENTER_NOTIF(MOVETOSPEC_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGMoving to spectator in ^COUNT..."), "")
+ MSG_CENTER_NOTIF(MOVETOSPEC_IDLING, N_ENABLE, 0, 1, "", CPID_IDLING, "1 f1", _("^K1Stop idling!\n^BGMoving to spectators in ^COUNT..."), "")
MSG_CENTER_NOTIF(DOOR_LOCKED_NEED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^BGYou need %s^BG!"), "")
MSG_CENTER_NOTIF(DOOR_LOCKED_ALSONEED, N_ENABLE, 1, 0, "s1", CPID_Null, "0 0", _("^BGYou also need %s^BG!"), "")
SOUND(SPAWN, "misc/spawn");
SOUND(TALK, "misc/talk");
+SOUND(TALK2, "misc/talk2");
SOUND(TELEPORT, "misc/teleport");
}
break;
}
- case CNT_IDLE:
- {
- switch(num)
- {
- case 10: return ANNCE_NUM_IDLE_10;
- case 9: return ANNCE_NUM_IDLE_9;
- case 8: return ANNCE_NUM_IDLE_8;
- case 7: return ANNCE_NUM_IDLE_7;
- case 6: return ANNCE_NUM_IDLE_6;
- case 5: return ANNCE_NUM_IDLE_5;
- case 4: return ANNCE_NUM_IDLE_4;
- case 3: return ANNCE_NUM_IDLE_3;
- case 2: return ANNCE_NUM_IDLE_2;
- case 1: return ANNCE_NUM_IDLE_1;
- }
- break;
- }
case CNT_KILL:
{
switch(num)
#ifdef GAMEQC
const int CNT_NORMAL = 1;
const int CNT_GAMESTART = 2;
-const int CNT_IDLE = 3;
+//const int CNT_IDLE = 3;
const int CNT_KILL = 4;
const int CNT_RESPAWN = 5;
const int CNT_ROUNDSTART = 6;
if (IS_PLAYER(this))
{
- if (autocvar_sv_maxidle_playertospectator > 0 && CS(this).idlekick_lasttimeleft)
- {
- Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_IDLING);
- CS(this).idlekick_lasttimeleft = 0;
- CS(this).parm_idlesince = time;
- }
-
if(GetResource(this, RES_HEALTH) >= 1)
{
// despawn effect
if (autocvar_sv_maxidle > 0 || (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0))
if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
if (IS_REAL_CLIENT(this))
- if (IS_PLAYER(this) || autocvar_sv_maxidle_spectatorsareidle)
+ if (IS_PLAYER(this) || autocvar_sv_maxidle_alsokickspectators)
+ if (!intermission_running) // NextLevel() kills all centerprints after setting this true
{
int totalClients = 0;
if(autocvar_sv_maxidle > 0 && autocvar_sv_maxidle_slots > 0)
if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
maxidle_time = autocvar_sv_maxidle_playertospectator;
float timeleft = ceil(maxidle_time - (time - CS(this).parm_idlesince));
- if (timeleft == min(10, maxidle_time - 1)) { // - 1 to support maxidle_time <= 10
- if (!CS(this).idlekick_lasttimeleft)
- {
- if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
- else
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
- }
+ float countdown_time = max(min(10, maxidle_time - 1), ceil(maxidle_time * 0.33)); // - 1 to support maxidle_time <= 10
+ if (timeleft == countdown_time && !CS(this).idlekick_lasttimeleft)
+ {
+ if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOVETOSPEC_IDLING, timeleft);
+ else
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
}
if (timeleft <= 0) {
if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0)
{
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MOVETOSPEC_IDLING, this.netname, maxidle_time);
if (this.caplayer)
this.caplayer = 0;
PutObserverInServer(this);
- CS(this).parm_idlesince = time;
}
else
{
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time);
dropclient(this);
}
return;
}
- else if (timeleft <= 10) {
+ else if (timeleft <= countdown_time) {
if (timeleft != CS(this).idlekick_lasttimeleft)
- Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
+ play2(this, SND(TALK2));
CS(this).idlekick_lasttimeleft = timeleft;
}
}
float autocvar_sv_foginterval;
float autocvar_sv_maxidle;
float autocvar_sv_maxidle_playertospectator;
-bool autocvar_sv_maxidle_spectatorsareidle;
+bool autocvar_sv_maxidle_alsokickspectators;
int autocvar_sv_maxidle_slots;
bool autocvar_sv_maxidle_slots_countbots;
bool autocvar_g_forced_respawn;
bool SetPlayerTeam(entity player, int team_index, int type)
{
int old_team_index = Entity_GetTeamIndex(player);
+
if (!Player_SetTeamIndex(player, team_index))
- {
return false;
- }
+
LogTeamChange(player.playerid, player.team, type);
+
if (team_index != old_team_index)
{
- PlayerScore_Clear(player);
- if (team_index != -1)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(
- player.team, INFO_JOIN_PLAY_TEAM), player.netname);
- }
- else
- {
- if (!CS(player).just_joined)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE,
- player.netname);
- }
- }
KillPlayerForTeamChange(player);
+ PlayerScore_Clear(player);
+ CS(player).parm_idlesince = time;
+
if (!IS_BOT_CLIENT(player))
- {
TeamBalance_AutoBalanceBots();
- }
+
+ if (team_index != -1)
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(player.team, INFO_JOIN_PLAY_TEAM), player.netname);
}
- else if (team_index == -1)
+
+ if (team_index == -1)
{
- if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
+ if (autocvar_sv_maxidle_playertospectator > 0 && CS(player).idlekick_lasttimeleft)
+ {
+ // this done here so it happens even when manually speccing during the countdown
+ Kill_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CPID_IDLING);
+ CS(player).idlekick_lasttimeleft = 0;
+ }
+ else if (!CS(player).just_joined && player.frags != FRAGS_SPECTATOR)
+ {
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, player.netname);
+ }
}
+
return true;
}
BADPREFIX("skill_");
BADPREFIX("sv_allow_");
BADPREFIX("sv_cullentities_");
- BADPREFIX("sv_maxidle_");
+ BADPREFIX("sv_maxidle");
BADPREFIX("sv_minigames_");
BADPREFIX("sv_radio_");
BADPREFIX("sv_timeout_");
BADCVAR("sv_defaultplayercolors");
BADCVAR("sv_defaultplayermodel");
BADCVAR("sv_defaultplayerskin");
- BADCVAR("sv_maxidle");
BADCVAR("sv_maxrate");
BADCVAR("sv_motd");
BADCVAR("sv_public");
set sv_foginterval 1 "force enable fog in regular intervals"
set sv_maxidle 0 "kick players idle for more than this amount of time in seconds"
-set sv_maxidle_spectatorsareidle 0 "when sv_maxidle is not 0, assume spectators are idle too"
+set sv_maxidle_alsokickspectators 1 "when sv_maxidle is > 0, kick idle spectators as well as players"
set sv_maxidle_slots 0 "when not 0, only kick idlers when this many or less player slots are available"
set sv_maxidle_slots_countbots 1 "count bots as player slots"
-set sv_maxidle_playertospectator 0 "move players idle for more than this amount of time in seconds to spectators (sv_maxidle timer starts again after sv_maxidle_playertospectator has moved a player to spectators)"
+set sv_maxidle_playertospectator 60 "move players idle for more than this amount of time in seconds to spectators (sv_maxidle timer starts again after sv_maxidle_playertospectator has moved a player to spectators)"
sv_allowdownloads_inarchive 1 // for csprogs.dat
sv_allowdownloads 0 // download protocol is evil