// ==============================
// free for all and team mayhem
// ==============================
++<<<<<<< HEAD
+set g_mayhem 0 "Mayhem: Compete for the most damage dealt and frags in this chaotic mayhem!"
+set g_tmayhem 0 "Team Mayhem: Compete with your team for the most damage dealt and frags in this chaotic mayhem!"
+
+set g_mayhem_scoringmethod 1 "1: By default 25% of the score is based on kills and 75% of it is based on damage. 2: 100% frags. 3: 100% damage."
+set g_tmayhem_scoringmethod 1 "1: By default 25% of the score is based on kills and 75% of it is based on damage. 2: 100% frags. 3: 100% damage."
+set g_mayhem_scoringmethod_1_damage_weight 0.75 "for the first scoring method how much is damage equal to player's spawning health worth in score"
+set g_tmayhem_scoringmethod_1_damage_weight 0.75 "for the first scoring method how much is damage equal to player's spawning health worth in score"
+set g_mayhem_scoringmethod_1_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding"
+set g_tmayhem_scoringmethod_1_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding"
+set g_mayhem_scoringmethod_1_frag_weight 0.25 "for the first scoring method how much is a frag worth in score"
+set g_tmayhem_scoringmethod_1_frag_weight 0.25 "for the first scoring method how much is a frag worth in score"
+
+set g_mayhem_fraglimit 30 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably"
+set g_tmayhem_fraglimit 50 "Team Mayhem basis for how many frags until the match ends, edit this over point_limit preferably"
+
+set g_mayhem_visual_score_limit 1000 "Mayhem visual score limit overriding the mapinfo specified one"
+set g_tmayhem_visual_score_limit 1000 "Team Mayhem visual score limit overriding the mapinfo specified one"
+
+set g_tmayhem_score_leadlimit -1 "Team Mayhem score lead limit(based on tmayhem_visual_score_limit, not tmayhem_fraglimit) overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
++=======
+ set g_mayhem 0 "Mayhem: Compete for the most damage dealt and kills in this chaotic mayhem!"
+ set g_tmayhem 0 "Team Mayhem: Compete with your team for the most damage dealt and kills in this chaotic mayhem!"
+
+ set g_mayhem_scoring_upscaler 20 "upscale one frag's worth to be this amount of in score"
+ set g_tmayhem_scoring_upscaler 20 "upscale one frag's worth to be this amount of in score"
+ set g_mayhem_scoring_kill_weight 0.25 "how much is a kill worth in frags"
+ set g_tmayhem_scoring_kill_weight 0.25 "how much is a kill worth in frags"
+ set g_mayhem_scoring_damage_weight 0.75 "how much is damage equal to player's spawning health+armor worth in frags"
+ set g_tmayhem_scoring_damage_weight 0.75 "how much is damage equal to player's spawning health+armor worth in frags"
+ set g_mayhem_scoring_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding"
+ set g_tmayhem_scoring_disable_selfdamage2score 0 "disable reducing score with self damage at the cost of full penalty for suicides regardless of how much health was lost suiciding"
+
+ set g_mayhem_point_limit -1 "Mayhem score limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+ set g_mayhem_point_leadlimit -1 "Mayhem score lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+ set g_tmayhem_point_limit -1 "Team Mayhem score limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+ set g_tmayhem_point_leadlimit -1 "Team Mayhem score lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
++>>>>>>> master
set g_mayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena"
set g_tmayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena"
REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // QUICKMENU
REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
REGISTER_HUD_PANEL(STRAFEHUD, HUD_StrafeHUD, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // STRAFEHUD
+ REGISTER_HUD_PANEL(PICKUP, HUD_Pickup, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PICKUP
+REGISTER_HUD_PANEL(SPECTHUD, HUD_SpectHUD, PANEL_CONFIG_NO | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // SPECTHUD
// always add new panels to the end of list
// Because calling lots of functions in QC apparently cuts fps in half on many machines:
if(mode == "")
{
- if(file == "" || file == "0")
- mode = "default";
- else
+ if(autocvar__hud_panel_quickmenu_file_from_server)
+ {
mode = "file";
+ file = autocvar__hud_panel_quickmenu_file_from_server;
+ }
+ else
+ mode = "default";
}
+ if(mode == "default")
+ {
+ if (autocvar_hud_panel_quickmenu_server_is_default && autocvar__hud_panel_quickmenu_file_from_server != "")
+ {
+ mode = "file";
+ file = autocvar__hud_panel_quickmenu_file_from_server;
+ }
+ }
+
if(mode == "file")
{
if(file == "" || file == "0")
bool autocvar_hud_panel_scoreboard_playerid = false;
string autocvar_hud_panel_scoreboard_playerid_prefix = "#";
string autocvar_hud_panel_scoreboard_playerid_suffix = " ";
+ bool autocvar_hud_panel_scoreboard_scores_per_round;
+
+int average_ping[NUM_TEAMS];
+int total_weapons;
+
float scoreboard_time;
+ SHUTDOWN(scoreboard)
+ {
+ if(autocvar_hud_panel_scoreboard_scores_per_round)
+ cvar_set("hud_panel_scoreboard_scores_per_round", "0");
+ }
+
// mode 0: returns translated label
// mode 1: prints name and description of all the labels
string Label_getInfo(string label, int mode)
// otherwise the previous exclusive rule warns anyway
// e.g. -teams,rc,cts,lms/kills ?+rc/kills
#define SCOREBOARD_DEFAULT_COLUMNS \
-"ping pl fps name |" \
+"ping pl fps cn name |" \
- " -teams,rc,cts,inv,lms/kills +ft,tdm/kills ?+rc,inv/kills" \
- " -teams,lms/deaths +ft,tdm/deaths" \
+ " -teams,rc,cts,inv,lms/kills +ft,tdm,tmayhem/kills ?+rc,inv/kills" \
+ " -teams,lms/deaths +ft,tdm,tmayhem/deaths" \
" +tdm/sum" \
- " -teams,lms,rc,cts,inv,ka/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
- " -cts,dm,tdm,ka,ft/frags" /* tdm already has this in "score" */ \
- " +tdm,ft,dom,ons,as/teamkills"\
+ " -teams,lms,rc,cts,inv,ka/suicides +ft,tdm,tmayhem/suicides ?+rc,inv/suicides" \
+ " -cts,dm,tdm,ka,ft,mayhem,tmayhem/frags" /* tdm already has this in "score" */ \
+ " +tdm,ft,dom,ons,as,tmayhem/teamkills"\
" -rc,cts,nb/dmg -rc,cts,nb/dmgtaken" \
" +ctf/pickups +ctf/fckills +ctf/returns +ctf/caps +ons/takes +ons/caps" \
" +lms/lives +lms/rank" \
sbt_field_icon2_rgb = colormapPaletteColor(f % 16, 1);
}
}
- return entcs_GetName(pl.sv_entnum);
+ if(entcs_GetRank(pl.sv_entnum) != "")
+ return strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum));
+ else
+ return entcs_GetName(pl.sv_entnum);
+}
+
+//LegendGuard adds GetCountrycode function 05-04-2021
+string Scoreboard_GetCountrycode(entity pl)
+{
+ int ccode = entcs_GetCountryCode(pl.sv_entnum);
+ if(ccode)
+ sbt_field_icon3 = strcat("gfx/flags/", ftos(ccode));
+ else
+ sbt_field_icon3 = strcat("gfx/flags/", ftos(0)); //if user hasn't assigned country flag
+
+ return "";
- //return ftos(entcs_GetCountryCode(pl.sv_entnum)); //returns a number
}
- vector getPingColor(float f)
- {
- if(f < 80) {
- // 20-80 range is green
- return '0 1 0' + '1 0 1' * max(0, min(60, f-20)) / 60;
- } else {
- // 80-300 range is red
- return '1 1 1' - '0 1 1' * max(0, min(220, f-80)) / 220;
- }
- }
- string Scoreboard_GetField(entity pl, PlayerScoreField field)
+ int autocvar_hud_panel_scoreboard_ping_best = 0;
+ int autocvar_hud_panel_scoreboard_ping_medium = 70;
+ int autocvar_hud_panel_scoreboard_ping_high = 100;
+ int autocvar_hud_panel_scoreboard_ping_worst = 150;
+ vector autocvar_hud_panel_scoreboard_ping_best_color = '0 1 0';
+ vector autocvar_hud_panel_scoreboard_ping_medium_color = '1 1 0';
+ vector autocvar_hud_panel_scoreboard_ping_high_color = '1 0.5 0';
+ vector autocvar_hud_panel_scoreboard_ping_worst_color = '1 0 0';
+ #define PING_BEST autocvar_hud_panel_scoreboard_ping_best
+ #define PING_MED autocvar_hud_panel_scoreboard_ping_medium
+ #define PING_HIGH autocvar_hud_panel_scoreboard_ping_high
+ #define PING_WORST autocvar_hud_panel_scoreboard_ping_worst
+ #define COLOR_BEST autocvar_hud_panel_scoreboard_ping_best_color
+ #define COLOR_MED autocvar_hud_panel_scoreboard_ping_medium_color
+ #define COLOR_HIGH autocvar_hud_panel_scoreboard_ping_high_color
+ #define COLOR_WORST autocvar_hud_panel_scoreboard_ping_worst_color
+ string Scoreboard_GetField(entity pl, PlayerScoreField field, bool per_round)
{
float tmp, num, denom;
int f;
if(this_team == NUM_SPECTATOR)
{
if(autocvar_hud_panel_scoreboard_spectators_showping)
- field = Scoreboard_GetField(pl, SP_PING);
+ field = Scoreboard_GetField(pl, SP_PING, autocvar_hud_panel_scoreboard_scores_per_round);
}
else if(autocvar_hud_panel_scoreboard_others_showscore)
- field = Scoreboard_GetField(pl, SP_SCORE);
+ field = Scoreboard_GetField(pl, SP_SCORE, autocvar_hud_panel_scoreboard_scores_per_round);
- string str = entcs_GetName(pl.sv_entnum);
+ string str;
+ if(entcs_GetRank(pl.sv_entnum) != "")
+ str = strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum));
+ else
+ str = entcs_GetName(pl.sv_entnum);
if (autocvar_hud_panel_scoreboard_playerid)
str = Scoreboard_AddPlayerId(str, pl);
str = textShortenToWidth(str, namesize, hud_fontsize, stringwidth_colors);
str = strcat(str, Scoreboard_Fraglimit_Draw(ll, true));
}
}
+
drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right
// map name and player count
- str = sprintf(_("^5%d^7/^5%d ^7players"), numplayers, srv_maxplayers ? srv_maxplayers : maxclients);
+ if (campaign)
+ str = "";
+ else
+ str = sprintf(_("^5%d^7/^5%d ^7players"), numplayers, srv_maxplayers ? srv_maxplayers : maxclients);
str = strcat("^7", _("Map:"), " ^2", mi_shortname, " ", str); // reusing "Map:" translatable string
drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left
}
vector timer_color = '1 1 1';
vector subtimer_color = '1 1 1';
bool swap = (autocvar_hud_panel_timer_secondary == 2 && STAT(ROUNDSTARTTIME));
+ float timeout_last = STAT(TIMEOUT_LAST);
// Use real or frozen time and get the time limit
- if(intermission_time)
- curtime = intermission_time;
- else if(timeout_last)
- curtime = timeout_last;
- else
- curtime = time;
-
- if(warmup_stage)
- timelimit = STAT(WARMUP_TIMELIMIT);
- else
- timelimit = STAT(TIMELIMIT) * 60;
+ curtime = (intermission_time ? intermission_time : time);
+ timelimit = (warmup_stage ? STAT(WARMUP_TIMELIMIT) : STAT(TIMELIMIT) * 60);
// Calculate time left
timeleft = HUD_Timer_TimeLeft(curtime, STAT(GAMESTARTTIME), timelimit);
if(!intermission_time && !warmup_stage && timelimit > 0)
timer_color = HUD_Timer_Color(timeleft);
++<<<<<<< HEAD
+ // countdown sound
+ // if 3 use server dictated option, otherwise the client's
+ int countdown_type;
+ if(autocvar_cl_timer_countdown == 3)
+ countdown_type = sv_timer_countdown;
+ else
+ countdown_type = autocvar_cl_timer_countdown;
+
+ if(countdown_type && !warmup_stage && timeleft > 0 && timeleft != last_timeleft && timeleft <= 10 && !intermission_time)
+ {
+ if(countdown_type == 1 || (countdown_type == 2 && spectatee_status))
+ sound(NULL, CH_INFO, SND_ENDCOUNT, VOL_BASE, ATTN_NONE);
+
+ last_timeleft = timeleft;
+ }
+
// Timer text
- if (warmup_stage && timelimit == -1)
- {
- // Lock timer in infinite warmup
- if (autocvar_hud_panel_timer_increment)
- timer = 0;
- else
- timer = STAT(TIMELIMIT) * 60;
- }
+ if (autocvar_hud_panel_timer_increment || timelimit <= 0)
+ timer = HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME));
else
- {
- if (autocvar_hud_panel_timer_increment || timelimit <= 0)
- timer = HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME));
- else
- timer = timeleft;
- }
+ timer = timeleft;
// Secondary timer for round-based game modes
if(STAT(ROUNDSTARTTIME) && autocvar_hud_panel_timer_secondary)
{
if(STAT(ROUNDSTARTTIME) == -1) {
// Round can't start
- subtimer = "--:--";
+ subtimer_str = "--:--";
subtimer_color = '1 0 0';
} else {
- float round_curtime, round_timelimit, round_timeleft;
+ float round_curtime, round_endtime, round_timelimit, round_timeleft;
// Use real or frozen time and get the time limit
- round_curtime = (game_stopped_time ? game_stopped_time : time);
+ round_endtime = STAT(ROUNDENDTIME);
round_timelimit = STAT(ROUND_TIMELIMIT);
+ if(round_endtime)
+ round_curtime = round_endtime;
+ else if(timeout_last)
+ round_curtime = timeout_last;
+ else
+ round_curtime = time;
+
// Calculate time left
round_timeleft = HUD_Timer_TimeLeft(round_curtime, STAT(ROUNDSTARTTIME), round_timelimit);
string entcs_GetName(int i)
{
entity e = entcs_receiver(i);
- return ColorTranslateRGB(e ? e.netname : getplayerkeyvalue(i, "name"));
+ return e ? ColorTranslateRGB(e.netname) : "";
}
+
+ int entcs_GetCountryCode(int i)
+ {
+ entity e = entcs_receiver(i);
+ return e.countrycode;
+ }
+
+ string entcs_GetRank(int i)
+ {
+ entity e = entcs_receiver(i);
+ return e.rank;
+ }
/**
* @param i zero indexed player
#endif
#ifdef CSQC
- #include <client/hud/hud.qh>
+ #include <client/hud/panel/pickup.qh>
-Inventory g_inventory;
+//Inventory g_inventory;
+Inventory inventoryslots[255];
- float last_pickup_timer;
- entity last_pickup_item;
- int last_pickup_times;
void Inventory_remove(entity this)
{
void Inventory_new(PlayerState this)
{
Inventory inv = NEW(Inventory);
- setcefc(inv, Inventory_customize);
+ inv.owner = this;
this.inventory = inv;
- inv.owner = this;
- Net_LinkEntity(inv, false, 0, Inventory_Send);
+
+ if(!g_duel) {
+ setcefc(inv, Inventory_customize);
+ Net_LinkEntity(inv, false, 0, Inventory_Send);
+ }
}
+
void Inventory_delete(entity e) { delete(e.inventory); }
-void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
+void Inventory_update(entity e)
+{
+ if(g_duel)
+ Inventory_Broadcast(e.inventory);
+ else
+ e.inventory.SendFlags = 0xFFFFFF;
+}
+ void Inventory_pickupitem(Pickup this, entity player)
+ {
+ //LOG_DEBUGF("entity %i picked up %s", player, this.m_name);
+ entity store = IS_PLAYER(player) ? PS(player) : player;
+ ++store.inventory.inv_items[this.m_id];
+ Inventory_update(store);
+ }
+
void Inventory_clear(entity store)
{
// NOTE: you will need to perform Inventory_update after this to update the storage entity
void monsters_setstatus(entity this)
{
- STAT(MONSTERS_TOTAL, this) = monsters_total;
- STAT(MONSTERS_KILLED, this) = monsters_killed;
+ //STAT(MONSTERS_TOTAL, this) = monsters_total;
+ //STAT(MONSTERS_KILLED, this) = monsters_killed;
}
+ bool autocvar_g_monsters_drop = true;
void monster_dropitem(entity this, entity attacker)
{
- if(!this.candrop || !this.monster_loot)
+ if(!this.candrop || !this.monster_loot || !autocvar_g_monsters_drop)
return;
vector org = CENTER_OR_VIEWOFS(this);
REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
REGISTER_NET_TEMP(TE_CSQC_SERVERWELCOME)
REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
+ REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
+REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES)
+REGISTER_NET_TEMP(TE_CSQC_CHATSOUND)
+REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
+REGISTER_NET_TEMP(TE_CSQC_TOTALSHARDS) // for RJZ
+
const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const int RACE_NET_CHECKPOINT_CLEAR = 1;
const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
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, 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, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked"), "")
+ 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_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_PLAYBAN_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was forced to spectate for excessive teamkilling"), "")
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"), "")
#include <common/gamemodes/_mod.qh>
#include <common/mapobjects/target/location.qh>
#include <common/mapobjects/triggers.qh>
+#include <common/net_linked.qh>
+ #include <common/notifications/all.qh>
#include <common/teams.qh>
#include <common/util.qh>
#include <common/weapons/weapon.qh>
sprint(source, sourcemsgstr);
dedicated_print(msgstr); // send to server console too
FOREACH_CLIENT(!(IS_PLAYER(it) || INGAME(it)) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
});
- event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));
+
+ if(!play_chatsound(source, msgin))
+ event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));
}
else
{
MX_Say(strcat(playername(source.netname, source.team, IS_PLAYER(source)), "^7: ", msgin));
}
FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
+ if(IS_REAL_CLIENT(source) && ignore_playerinlist(source, it)) // check ignored players from personal chat log (from "ignore" command)
+ continue; // no sending to this player, thank you very much
+
sprint(it, msgstr);
});
- event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin));
+
+ if(!play_chatsound(source, msgin))
+ event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin));
}
}
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
#define BAN_COMMANDS(request, arguments, command) \
- BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \
- BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \
- BAN_COMMAND("kickkick", BanCommand_kickkick(request, arguments, command), "Disconnect a client") \
- BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \
- BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \
- BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \
- BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \
+ BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \
+ BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \
++ BAN_COMMAND("kickkick", BanCommand_kickkick(request, arguments, command), "Disconnect a client") \
+ BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \
+ BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \
+ BAN_COMMAND("playban", BanCommand_playban(request, arguments, command), "Force to spectate a client permanently") \
+ BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \
+ BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \
+ BAN_COMMAND("unvoteban", BanCommand_unvoteban(request, arguments), "Remove an existing voting ban") \
+ BAN_COMMAND("unplayban", BanCommand_unplayban(request, arguments), "Remove an existing forced to spectate ban") \
+ BAN_COMMAND("voteban", BanCommand_voteban(request, arguments, command), "Disallow a client from voting") \
/* nothing */
void BanCommand_macro_help()
{
case CMD_REQUEST_COMMAND:
{
- if (IS_CLIENT(caller) && caller.last_ready < time - 3)
+ if (warmup_stage || g_race_qualifying == 2)
+ if (IS_PLAYER(caller) || INGAME_JOINED(caller))
{
- if (warmup_stage || g_race_qualifying == 2)
+ if (caller.ready) // toggle
{
- if (time < game_starttime) // game is already restarting
- return;
- if (caller.ready) // toggle
- {
- caller.ready = false;
- if (IS_PLAYER(caller) || INGAME_JOINED(caller))
- bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
- }
- else
- {
- caller.ready = true;
- if (IS_PLAYER(caller) || INGAME_JOINED(caller))
- bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ready\n");
- }
-
- caller.last_ready = time;
- ReadyCount();
+ caller.ready = false;
+ bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
+ }
+ else
+ {
+ caller.ready = true;
- bprint(playername(caller.netname, caller.team, false), "^2 is ready\n");
++ bprint("\{1}", playername(caller.netname, caller.team, false), "^2 is ready\n");
}
+ ReadyCount();
}
return; // never fall through to usage
}
Nagger_VoteCountChanged();
// add up all the votes from each connected client
- FOREACH_CLIENT(IS_REAL_CLIENT(it) || autocvar_sv_vote_debug, {
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), {
+ // z411
+ if(vote_target_type == VOTE_TARGET_TEAM && it.team != vote_caller.team) continue;
+ if(vote_target_type == VOTE_TARGET_SINGLE && it != vote_target) continue;
+
++vote_player_count;
- if (IS_PLAYER(it)) ++vote_real_player_count;
+ if (IS_PLAYER(it) || INGAME(it)) ++vote_real_player_count;
switch (it.vote_selection)
{
case VOTE_SELECT_REJECT:
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
}
+ round_handler_Activate(!warmup_stage);
if (!sv_ready_restart_after_countdown || warmup_stage)
- reset_map(true, is_fake_round_start);
+ reset_map(is_fake_round_start);
if (autocvar_sv_eventlog) GameLogEcho(":restart");
}
// global vote information declarations
entity vote_caller; // original caller of the current vote
string vote_caller_name; // name of the vote caller
- float vote_called; // stores status of current vote (See VOTE_*)
+ int vote_called; // stores status of current vote (See VOTE_*)
float vote_endtime; // time when the vote is finished
- float vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function)
- float vote_reject_count; // same as above, but rejected
- float vote_abstain_count; // same as above, but abstained
- float vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
+ int vote_accept_count; // total amount of players who accept the vote (counted by VoteCount() function)
+ int vote_reject_count; // same as above, but rejected
+ int vote_abstain_count; // same as above, but abstained
+ int vote_needed_overall; // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
+float vote_target_type; // z411
+entity vote_target; // z411
- .float vote_master; // flag for if the player has vote master privelages
+ .bool vote_master; // flag for if the player has vote master privileges
.float vote_waittime; // flag for how long the player must wait before they can vote again
- .float vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
+ .int vote_selection; // flag for which vote selection the player has made (See VOTE_SELECT_*)
string vote_called_command; // command sent by client
string vote_called_display; // visual string of command sent by client
string vote_parsed_command; // command which is fixed after being parsed
{
pickedup = true;
FOREACH(Weapons, it != WEP_Null, {
++<<<<<<< HEAD
+ Weapon wep = it;
+
+ if(w & (wep.m_wepset)) {
+ // z411 Seriously find a better way to do this
+ Item_NotifyWeapon(player, wep.m_id);
+ FOREACH_CLIENT(IS_SPEC(it) && it.enemy == player, { Item_NotifyWeapon(it, wep.m_id); });
+ }
+
+ if(wp & (wep.m_wepset))
++=======
+ if(w & (it.m_wepset))
+ Item_NotifyWeapon(player, it.m_id);
+
+ if(wp & (it.m_wepset))
++>>>>>>> master
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
BADCVAR("g_spawn_alloweffects");
BADCVAR("g_tdm_point_leadlimit");
BADCVAR("g_tdm_point_limit");
- BADCVAR("g_mayhem_fraglimit");
- BADCVAR("g_tmayhem_fraglimit");
- BADCVAR("g_mayhem_visual_score_limit");
- BADCVAR("g_tmayhem_visual_score_limit");
- BADCVAR("g_tmayhem_score_leadlimit");
+ BADCVAR("g_mayhem_point_limit");
+ BADCVAR("g_mayhem_point_leadlimit");
+ BADCVAR("g_tmayhem_point_limit");
+ BADCVAR("g_tmayhem_point_leadlimit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("leadlimit_override");
+ BADCVAR("g_mayhem_scoringmethod");
+ BADCVAR("g_mayhem_scoringmethod_damage_weight");
+ BADCVAR("g_mayhem_scoringmethod_frag_weight");
+ BADCVAR("g_tmayhem_scoringmethod");
+ BADCVAR("g_tmayhem_scoringmethod_damage_weight");
+ BADCVAR("g_tmayhem_scoringmethod_frag_weight");
BADCVAR("pausable");
BADCVAR("sv_announcer");
+ BADCVAR("sv_autopause");
BADCVAR("sv_checkforpacketsduringsleep");
BADCVAR("sv_damagetext");
BADCVAR("sv_db_saveasdump");
WinningConditionHelper(this); // set worldstatus
+ round_handler_Activate(!warmup_stage);
+
+ // for RJZ
+ if (autocvar_rjz_count_shards && warmup_stage) {
+ total_shards = -2;
+ send_TotalShardsAll();
+ }
+
+ if (autocvar_sv_autopause && server_is_dedicated && !wantrestart)
+ // INITPRIO_LAST is to soon: bots either didn't join yet or didn't leave yet, see: bot_fixcount()
+ defer(this, 5, Pause_TryPause_Dedicated);
+
world_initialized = 1;
__spawnfunc_spawn_all();
}
*/
//pos = FindIntermission ();
+
+ sound(NULL, CH_INFO, SND_ENDMATCH, VOL_BASE, ATTN_NONE);
- VoteReset();
+ VoteReset(true);
DumpStats(true);
serverflags &= ~SERVERFLAG_ALLOW_FULLBRIGHT;
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
+ if(cvar("sv_forbid_pickuptimer"))
+ serverflags |= SERVERFLAG_FORBID_PICKUPTIMER;
- sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown");
+ serverflags &= ~SERVERFLAG_FORBID_PICKUPTIMER;
+ if(cvar("sv_forbid_pickuptimer"))
+ serverflags |= SERVERFLAG_FORBID_PICKUPTIMER;
- warmup_stage = cvar("g_warmup");
- warmup_limit = cvar("g_warmup_limit");
+ sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown");
if(cvar("g_campaign"))
warmup_stage = 0; // no warmup during campaign
bool autocvar_sv_gameplayfix_droptofloorstartsolid;
bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect;
++<<<<<<< HEAD
+// z411
+bool autocvar_sv_jingle_end;
+string autocvar_sv_jingle_end_list;
+float autocvar_sv_jingle_end_volume;
+
+float fragsleft;
+int fragsleft_last;
++=======
+ bool autocvar_sv_mapformat_is_quake3;
+ bool autocvar_sv_mapformat_is_quake2;
++>>>>>>> master
float checkrules_equality;
float checkrules_suddendeathwarning;