}
case NOTIF_TEAM:
+ {
+ if not(teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); }
+ else if not(client.team) { checkargs = sprintf("%sNo team provided!", checkargs); }
+ break;
+ }
+
case NOTIF_TEAM_EXCEPT:
{
if not(teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); }
- else if(IS_NOT_A_CLIENT(client))
- {
- if(broadcast == NOTIF_TEAM) { checkargs = sprintf("%sNo client provided!", checkargs); }
- else { checkargs = sprintf("%sException can't be a non-client!", checkargs); }
- }
+ else if(IS_NOT_A_CLIENT(client)) { checkargs = sprintf("%sException can't be a non-client!", checkargs); }
break;
}
{
// check supplied broadcast, target, type, and name for errors
string checkargs = Notification_CheckArgs(broadcast, client, net_type, net_name);
- if(checkargs != "") { backtrace(sprintf("Incorrect usage of Send_Notification: %s\n", checkargs)); return; }
+ if(checkargs != "")
+ {
+ #ifdef NOTIFICATIONS_DEBUG
+ Debug_Notification(sprintf(
+ "Send_Notification(%s, '%s', %s, %d, ...);\n",
+ Get_Notif_BroadcastName(broadcast),
+ client.classname,
+ Get_Notif_TypeName(net_type),
+ Get_Notif_Ent(net_type, net_name).nent_name
+ ));
+ #endif
+ backtrace(sprintf("Incorrect usage of Send_Notification: %s\n", checkargs));
+ return;
+ }
// retreive counts for the arguments of this notification
entity notif = Get_Notif_Ent(net_type, net_name);
- if not(notif) { backtrace("Send_Notification: Could not find notification entity!\n"); return; }
+ if not(notif)
+ {
+ #ifdef NOTIFICATIONS_DEBUG
+ Debug_Notification(sprintf(
+ "Send_Notification(%s, '%s', %s, %d, ...);\n",
+ Get_Notif_BroadcastName(broadcast),
+ client.classname,
+ Get_Notif_TypeName(net_type),
+ net_name
+ ));
+ #endif
+ backtrace("Send_Notification: Could not find notification entity!\n");
+ return;
+ }
string s1 = ((0 < notif.nent_stringcount) ? ...(0, string) : "");
string s2 = ((1 < notif.nent_stringcount) ? ...(1, string) : "");
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
- "Send_Notification(%s, %s, %s, %s, %s);\n",
+ "Send_Notification(%s, '%s', %s, %s, %s, %s);\n",
Get_Notif_BroadcastName(broadcast),
+ client.classname,
Get_Notif_TypeName(net_type),
notif.nent_name,
MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
{
backtrace(sprintf(
strcat(
- "Not enough arguments for Send_Notification(%s, %s, %s, ...)! ",
+ "Not enough arguments for Send_Notification(%s, '%s', %s, %s, ...)! ",
"stringcount(%d) + floatcount(%d) > count(%d)\n",
"Check the definition and function call for accuracy...?\n"
),
Get_Notif_BroadcastName(broadcast),
+ client.classname,
Get_Notif_TypeName(net_type), notif.nent_name,
notif.nent_stringcount, notif.nent_floatcount, count
));
{
backtrace(sprintf(
strcat(
- "Too many arguments for Send_Notification(%s, %s, %s, ...)! ",
+ "Too many arguments for Send_Notification(%s, '%s', %s, %s, ...)! ",
"stringcount(%d) + floatcount(%d) < count(%d)\n",
"Check the definition and function call for accuracy...?\n"
),
Get_Notif_BroadcastName(broadcast),
+ client.classname,
Get_Notif_TypeName(net_type), notif.nent_name,
notif.nent_stringcount, notif.nent_floatcount, count
));
#ifdef NOTIFICATIONS_DEBUG
entity notif = Get_Notif_Ent(net_type, net_name);
Debug_Notification(sprintf(
- "Send_Notification_WOVA(%s, %s, %d, %d, %d, %s, %s);\n",
+ "Send_Notification_WOVA(%s, '%s', %s, %s, %d, %d, %s, %s);\n",
Get_Notif_BroadcastName(broadcast),
+ client.classname,
Get_Notif_TypeName(net_type),
notif.nent_name,
stringcount,
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
- "Send_Notification_WOCOVA(%s, %s, %s, %s, %s);\n",
+ "Send_Notification_WOCOVA(%s, '%s', %s, %s, %s, %s);\n",
Get_Notif_BroadcastName(broadcast),
+ client.classname,
Get_Notif_TypeName(net_type),
notif.nent_name,
MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
MSG_CHOICE_NOTIF(default, challow, prefix##PINK, chtype, optiona##PINK, optionb##PINK) \
#endif
#define MSG_CHOICE_NOTIFICATIONS \
- MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_TEAM, MSG_CENTER, CENTER_CTF_PICKUP_TEAM, CENTER_CTF_PICKUP_TEAM_VERBOSE) \
- MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_ENEMY, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY, CENTER_CTF_PICKUP_ENEMY_VERBOSE) \
- MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAG, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
- MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
- MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAG, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
- MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_BROKEN_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_BROKEN_) \
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_TIME_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_TIME_) \
+ MULTITEAM_CHOICE(1, 2, CHOICE_CTF_CAPTURE_UNBROKEN_, 2, MSG_INFO, INFO_CTF_CAPTURE_, INFO_CTF_CAPTURE_UNBROKEN_) \
+ MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_TEAM, MSG_CENTER, CENTER_CTF_PICKUP_TEAM, CENTER_CTF_PICKUP_TEAM_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 2, CHOICE_CTF_PICKUP_ENEMY, MSG_CENTER, CENTER_CTF_PICKUP_ENEMY, CENTER_CTF_PICKUP_ENEMY_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAG, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_FRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAG, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
+ MSG_CHOICE_NOTIF(1, 1, CHOICE_TYPEFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
//MSG_CHOICE_NOTIF(2, CHOICE_)
#define NOTIF_INFO_MAX 256
#define NOTIF_CENTER_MAX 256
#define NOTIF_MULTI_MAX 128
-#define NOTIF_CHOICE_MAX 8
+#define NOTIF_CHOICE_MAX 16
#define NOTIF_CPID_MAX 256 // should match NOTIF_CENTER_MAX
// notification entities
void ctf_CaptureRecord(entity flag, entity player)
{
- entity tmp_entity;
float cap_record = ctf_captimerecord;
float cap_time = (time - flag.ctf_pickuptime);
string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
// notify about shit
- FOR_EACH_REALCLIENT(tmp_entity)
- {
- if(tmp_entity.CAPTURE_VERBOSE)
- {
- if(!ctf_captimerecord) { Send_Notification(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_TIME_), player.netname, (cap_time * 100)); }
- else if(cap_time < cap_record) { Send_Notification(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_BROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
- else { Send_Notification(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_UNBROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
- }
- else { Send_Notification(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_), player.netname); }
- }
-
- // the previous notification broadcast is only sent to real clients, this will notify server log too
- if(server_is_dedicated)
- {
- if(autocvar_notification_ctf_capture_verbose)
- {
- if(!ctf_captimerecord) { Local_Notification(MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_TIME_), player.netname, (cap_time * 100)); }
- else if(cap_time < cap_record) { Local_Notification(MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_BROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
- else { Local_Notification(MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_UNBROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
- }
- else { Local_Notification(MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_), player.netname); }
- }
+ if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_TIME_), player.netname, (cap_time * 100)); }
+ else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_BROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
+ else { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT_2(flag, CHOICE_CTF_CAPTURE_UNBROKEN_), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
// write that shit in the database
if((!ctf_captimerecord) || (cap_time < cap_record))
// messages and sounds
Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname);
+
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_));
if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); }
- Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CENTER, CHOICE_CTF_PICKUP_TEAM, Team_ColorCode(player.team), player.netname);
- Send_Notification(NOTIF_TEAM, flag, MSG_CENTER, CHOICE_CTF_PICKUP_ENEMY, Team_ColorCode(player.team), player.netname);
+
+ Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, CHOICE_CTF_PICKUP_TEAM, Team_ColorCode(player.team), player.netname);
+ Send_Notification(NOTIF_TEAM, flag, MSG_CHOICE, CHOICE_CTF_PICKUP_ENEMY, Team_ColorCode(player.team), player.netname);
+
sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
// scoring
return TRUE;
}
-MUTATOR_HOOKFUNCTION(ctf_GetCvars)
-{
- GetCvars_handleFloat(get_cvars_s, get_cvars_f, CAPTURE_VERBOSE, "notification_ctf_capture_verbose");
- return TRUE;
-}
-
// ==========
// Spawnfuncs
MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
MUTATOR_HOOK(HavocBot_ChooseRule, ctf_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetCvars, ctf_GetCvars, CBC_ORDER_ANY);
MUTATOR_ONADD
{
float havocbot_ctf_middlepoint_radius;
void havocbot_role_ctf_setrole(entity bot, float role);
-
-// client notification stuff
-.float CAPTURE_VERBOSE;
#endif
-var float autocvar_notification_ctf_capture_verbose = FALSE;