MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON, 0, 1, "item_wepname", CPID_NIX, "0 0", _("^F2Active weapon: ^F1%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_JOIN_NOSPAWNS, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1No spawnpoints available!\nHope your team can fix it..."), "") \
MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \
- MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME, 0, 1, "f1time", CPID_OVERTIME, "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s ^F2minute(s) to the game!"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME, 0, 1, "f1time", CPID_OVERTIME, "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s ^F2to the game!"), "") \
MSG_CENTER_NOTIF(1, CENTER_OVERTIME_FRAG, 0, 0, "", CPID_OVERTIME, "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nKeep fragging until we have a winner!"), _("^F2Now playing ^F4OVERTIME^F2!\nKeep scoring until we have a winner!")) \
MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_INVISIBILITY, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Invisibility has worn off"), "") \
MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_SHIELD, 0, 0, "", CPID_POWERUP, "0 0", _("^F2Shield has worn off"), "") \
ARG_CASE(ARG_CS, "f3primsec", (f3 ? _("secondary") : _("primary"))) \
ARG_CASE(ARG_CS, "f1secs", count_seconds(f1)) \
ARG_CASE(ARG_CS_SV, "f1ord", count_ordinal(f1)) \
- ARG_CASE(ARG_CS, "f1time", process_time("todo", f1)) \
+ ARG_CASE(ARG_CS, "f1time", process_time(2, f1)) \
ARG_CASE(ARG_CS_SV, "f1race_time", mmssss(f1)) \
ARG_CASE(ARG_CS_SV, "f2race_time", mmssss(f2)) \
ARG_CASE(ARG_CS_SV, "race_col", CCR(((f1 == 1) ? "^F1" : "^F2"))) \
return "";
}
-string process_time(string fields, float seconds)
+string process_time(float outputtype, float seconds)
{
float tmp_hours = 0, tmp_minutes = 0, tmp_seconds = 0;
float tmp_years = 0, tmp_weeks = 0, tmp_days = 0;
tmp_seconds = floor(seconds);
if(tmp_seconds)
- { tmp_minutes = floor(tmp_seconds / 60); }
-
- if(tmp_minutes)
- { tmp_seconds -= (tmp_minutes * 60);
- tmp_hours = floor(tmp_minutes / 60); }
-
- if(tmp_hours)
- { tmp_minutes -= (tmp_hours * 60); }
-
- if(tmp_hours)
- { tmp_days = floor(tmp_hours / 24); }
+ {
+ tmp_minutes = floor(tmp_seconds / 60);
+
+ if(tmp_minutes)
+ {
+ tmp_seconds -= (tmp_minutes * 60);
+ tmp_hours = floor(tmp_minutes / 60);
- if(tmp_days)
- { tmp_hours -= (tmp_days * 60);
- tmp_weeks = floor(tmp_days / 7); }
-
- if(tmp_weeks)
- { tmp_days -= (tmp_weeks * 60);
- tmp_years = floor(tmp_weeks / 52); }
+ if(tmp_hours)
+ {
+ tmp_minutes -= (tmp_hours * 60);
+ tmp_days = floor(tmp_hours / 24);
+
+ if(tmp_days)
+ {
+ tmp_hours -= (tmp_days * 24);
+ tmp_weeks = floor(tmp_days / 7);
+
+ if(tmp_weeks)
+ {
+ tmp_days -= (tmp_weeks * 7);
+ tmp_years = floor(tmp_weeks / 52);
+ }
+ }
+ }
+ }
+ }
- //fields = strreplace("
- /*switch(output)
+ switch(outputtype)
{
case 1: return sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds);
- //todo
- default: return "";
- }*/
+ case 2:
+ {
+ string output = "";
+
+ output = count_seconds(tmp_seconds);
+
+ if(tmp_minutes)
+ {
+ output = sprintf(
+ "%s%s",
+ count_minutes(tmp_minutes),
+ ((output != "") ? sprintf(", %s", output) : ""));
+ }
+
+ if(tmp_hours)
+ {
+ output = sprintf(
+ "%s%s",
+ count_hours(tmp_hours),
+ ((output != "") ? sprintf(", %s", output) : ""));
+ }
+
+ if(tmp_days)
+ {
+ output = sprintf(
+ "%s%s",
+ count_days(tmp_days),
+ ((output != "") ? sprintf(", %s", output) : ""));
+ }
+
+ if(tmp_weeks)
+ {
+ output = sprintf(
+ "%s%s",
+ count_weeks(tmp_weeks),
+ ((output != "") ? sprintf(", %s", output) : ""));
+ }
+
+ if(tmp_years)
+ {
+ output = sprintf(
+ "%s%s",
+ count_years(tmp_years),
+ ((output != "") ? sprintf(", %s", output) : ""));
+ }
+
+ return output;
+ }
+ }
return "";
}
vector animfixfps(entity e, vector a, vector b);
#endif
-#define count_minutes_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s minutes")), ftos_decimals(time, decs))
+#define count_years_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s years")), ftos_decimals(time, decs))
+#define count_years(time) count_fill(time, \
+ ZCTX(_("CI_ZER^%d years")), /* zeroth */ \
+ ZCTX(_("CI_FIR^%d year")), /* first */ \
+ ZCTX(_("CI_SEC^%d years")), /* year */ \
+ ZCTX(_("CI_THI^%d years")), /* third */ \
+ ZCTX(_("CI_MUL^%d years"))) /* multi */
+
+#define count_weeks_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s weeks")), ftos_decimals(time, decs))
+#define count_weeks(time) count_fill(time, \
+ ZCTX(_("CI_ZER^%d weeks")), /* zeroth */ \
+ ZCTX(_("CI_FIR^%d week")), /* first */ \
+ ZCTX(_("CI_SEC^%d weeks")), /* week */ \
+ ZCTX(_("CI_THI^%d weeks")), /* third */ \
+ ZCTX(_("CI_MUL^%d weeks"))) /* multi */
+
+#define count_days_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s days")), ftos_decimals(time, decs))
+#define count_days(time) count_fill(time, \
+ ZCTX(_("CI_ZER^%d days")), /* zeroth */ \
+ ZCTX(_("CI_FIR^%d day")), /* first */ \
+ ZCTX(_("CI_SEC^%d days")), /* day */ \
+ ZCTX(_("CI_THI^%d days")), /* third */ \
+ ZCTX(_("CI_MUL^%d days"))) /* multi */
+
+#define count_hours_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s hours")), ftos_decimals(time, decs))
+#define count_hours(time) count_fill(time, \
+ ZCTX(_("CI_ZER^%d hours")), /* zeroth */ \
+ ZCTX(_("CI_FIR^%d hour")), /* first */ \
+ ZCTX(_("CI_SEC^%d hours")), /* hour */ \
+ ZCTX(_("CI_THI^%d hours")), /* third */ \
+ ZCTX(_("CI_MUL^%d hours"))) /* multi */
+
+#define count_minutes_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s minutes")), ftos_decimals(time, decs))
#define count_minutes(time) count_fill(time, \
ZCTX(_("CI_ZER^%d minutes")), /* zeroth */ \
ZCTX(_("CI_FIR^%d minute")), /* first */ \
ZCTX(_("CI_MUL^%d minutes"))) /* multi */
#define count_seconds_decs(time,decs) sprintf(ZCTX(_("CI_DEC^%s seconds")), ftos_decimals(time, decs))
-
#define count_seconds(time) count_fill(time, \
ZCTX(_("CI_ZER^%d seconds")), /* zeroth */ \
ZCTX(_("CI_FIR^%d second")), /* first */ \
ZCTX(_("CI_MUL^%d seconds"))) /* multi */
string count_ordinal(float interval);
-
string count_fill(float interval, string zeroth, string first, string second, string third, string multi);
-
-string process_time(string fields, float seconds);
+string process_time(float outputtype, float seconds);
#ifdef SVQC
void dedicated_print(string input);
tmp_player.netname,
tmp_player.ping,
tmp_player.ping_packetloss,
- process_time("%02d:%02d:%02d", time - tmp_player.jointime),
+ process_time(2, time - tmp_player.jointime),
tmp_netaddress,
tmp_crypto_idfp));