Guidlines (please try and follow these):
ALWAYS start the string with a color, preferably background.
- ALWAYS end messages with a new line.
ALWAYS properly use tab spacing to even out the notifications.
NEVER re-declare an event twice.
NEVER add or remove fields from the format, it SHOULD already work.
- ARIRE unir frk jvgu lbhe bja zbgure. (gvc sbe zvxrrhfn) -- Don't pay attention to this ^_^
+ MSG_INFO messages must ALWAYS end with a new line: \n
Be clean and simple with your notification naming, nothing too long.
Keep the notifications in alphabetical order.
+ ARIRE unir frk jvgu lbhe bja zbgure. (gvc sbe zvxrrhfn) -- Don't pay attention to this ^_^
*/
// flag.netname = ((teamnumber) ? "^1RED^7 flag" : "^4BLUE^7 flag");
// weaponorder[f1].netname
#define MSG_INFO_NOTIFICATIONS \
- MSG_INFO_NOTIF(INFO_CTF_GOTFLAG_RED, 2, 1, XPND3(s1, s2, "foobar"), "notify_death", _("^F1%s^BG lost their marbles against ^F1%s^BG using the ^F2%s^BG\n"), "") \
+ MSG_INFO_NOTIF(INFO_CTF_EVENT_PICKUP_RED, 2, 1, XPND3(s1, s2, "foobar"), "notify_death", _("^F1%s^BG lost their marbles against ^F1%s^BG using the ^F2%s^BG\n"), "") \
#undef MSG_INFO_NOTIF
#define MSG_CENTER_NOTIFICATIONS \
+ MSG_CENTER_NOTIF(CENTER_EMPTY, 0, 0, NO_STR_ARG, NO_CPID, XPND2(0, 0), "", "") \
MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_SHIELDED, 0, 0, NO_STR_ARG, CPID_CTF_CAPTURESHIELD, XPND2(0, 0), _("^BGYou are now ^F1shielded^BG from the flag\n^BGfor ^F2too many unsuccessful attempts^BG to capture.\n^BGMake some defensive scores before trying again."), "") \
MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_FREE, 0, 0, NO_STR_ARG, CPID_CTF_CAPTURESHIELD, XPND2(0, 0), _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_RED, 2, 0, XPND2(s1, s2), CPID_CTF_PASS, XPND2(0, 0), _("^BG%s passed the ^1RED^BG flag to %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_SENT_RED, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou passed the ^1RED^BG flag to %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_RECEIVED_RED, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou received the ^1RED^BG flag from %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_BLUE, 2, 0, XPND2(s1, s2), CPID_CTF_PASS, XPND2(0, 0), _("^BG%s passed the ^4BLUE^BG flag to %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_SENT_BLUE, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou passed the ^4BLUE^BG flag to %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PASS_RECEIVED_BLUE, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou received the ^4BLUE^BG flag from %s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_RETURN, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou returned the ^F1%s"), "") \
- MSG_CENTER_NOTIF(CENTER_CTF_EVENT_CAPTURE, 0, 0, NO_STR_ARG, NO_CPID, XPND2(0, 0), _("^BGYou captured the ^F1%s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_OTHER_RED, 2, 0, XPND2(s1, s2), CPID_CTF_PASS, XPND2(0, 0), _("^BG%s passed the ^1RED^BG flag to %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_OTHER_BLUE, 2, 0, XPND2(s1, s2), CPID_CTF_PASS, XPND2(0, 0), _("^BG%s passed the ^4BLUE^BG flag to %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_SENT_RED, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou passed the ^1RED^BG flag to %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_SENT_BLUE, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou passed the ^4BLUE^BG flag to %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_RECEIVED_RED, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou received the ^1RED^BG flag from %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_RECEIVED_BLUE, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGYou received the ^4BLUE^BG flag from %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTING, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BGRequesting %s to pass you the flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTED, 1, 0, s1, CPID_CTF_PASS, XPND2(0, 0), _("^BG%s requests you to pass the flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_RETURN_RED, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou returned the ^1RED^BG flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_RETURN_BLUE, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou returned the ^4BLUE^BG flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_CAPTURE_RED, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou captured the ^1RED^BG flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_CAPTURE_BLUE, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou captured the ^4BLUE^BG flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_RED, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou got the ^1RED^BG flag!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_BLUE, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYou got the ^4BLUE^BG flag!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_TEAM, 1, 0, s1, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYour %steam mate^BG got the flag! Protect them!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_TEAM_VERBOSE, 2, 0, XPND3(s1, s2, s1), CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGYour %steam mate (^BG%s%s)^BG got the flag! Protect them!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_ENEMY, 1, 0, s1, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGThe %senemy^BG got your flag! Retrieve it!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_EVENT_PICKUP_ENEMY_VERBOSE, 2, 0, XPND3(s1, s2, s1), CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGThe %senemy (^BG%s%s)^BG got your flag! Retrieve it!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_CARRIER, 0, 0, NO_STR_ARG, CPID_STALEMATE, XPND2(0, 0), _("^BGStalemate! Enemies can now see you on radar!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_OTHER, 0, 0, NO_STR_ARG, CPID_STALEMATE, XPND2(0, 0), _("^BGStalemate! Flag carriers can now be seen by enemies on radar!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_FLAG_THROW_PUNISH, 0, 1, f1, CPID_CTF_LOWPRIO, XPND2(0, 0), _("^BGToo many flag throws! Throwing disabled for %d seconds."), "") \
#undef MSG_CENTER_NOTIF
#define MSG_WEAPON_NOTIFICATIONS \
#endif
#ifdef SVQC
-void Send_Notification(float net_type, entity client, float net_name, string s1, string s2, float f1, float f2, float f3)
+void Send_Notification(entity client, float net_type, float net_name, string s1, string s2, float f1, float f2, float f3)
{
if(net_type && net_name)
{
if(tmp_entity.team == targetteam)
if(tmp_entity != except)
{
- Send_Notification(net_type, tmp_entity, net_name, s1, s2, f1, f2, f3);
+ Send_Notification(tmp_entity, net_type, net_name, s1, s2, f1, f2, f3);
}
}
}
if((tmp_entity.classname == STR_PLAYER) || spectators)
if(tmp_entity != except)
{
- Send_Notification(net_type, tmp_entity, net_name, s1, s2, f1, f2, f3);
+ Send_Notification(tmp_entity, net_type, net_name, s1, s2, f1, f2, f3);
}
}
}
if((wanted_status == player.ctf_captureshielded) && (updated_status != wanted_status)) // 0: shield only, 1: unshield only
{
if(updated_status) // TODO csqc notifier for this // Samual: How?
- Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Make some defensive scores before trying again.", 5, 0);
+ Send_Notification(player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else
- Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now free.\n\n^3Feel free to ^1try to capture^3 the flag again\n^3if you think you will succeed.", 5, 0);
+ Send_Notification(player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_FREE, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
player.ctf_captureshielded = updated_status;
}
vector othermid = (other.absmin + other.absmax) * 0.5;
Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
- Send_CSQC_Centerprint_Generic(other, CPID_CTF_CAPTURESHIELD, "^3You are ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Get some defensive scores before trying again.", 5, 0);
+ Send_Notification(other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
void ctf_CaptureShield_Spawn(entity flag)
FOR_EACH_REALPLAYER(tmp_player)
{
if(tmp_player == sender)
- Send_Notification(MSG_CENTER, tmp_player, RED_OR_BLUE(flag, CENTER_CTF_EVENT_PASS_SENT_RED, CENTER_CTF_EVENT_PASS_SENT_BLUE), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification(tmp_player, MSG_CENTER, RED_OR_BLUE(flag, CENTER_CTF_PASS_SENT_RED, CENTER_CTF_PASS_SENT_BLUE), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else if(tmp_player == player)
- Send_Notification(MSG_CENTER, tmp_player, RED_OR_BLUE(flag, CENTER_CTF_EVENT_PASS_RECEIVED_RED, CENTER_CTF_EVENT_PASS_RECEIVED_BLUE), sender.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification(tmp_player, MSG_CENTER, RED_OR_BLUE(flag, CENTER_CTF_PASS_RECEIVED_RED, CENTER_CTF_PASS_RECEIVED_BLUE), sender.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else if(!IsDifferentTeam(tmp_player, sender))
- Send_Notification(MSG_CENTER, tmp_player, RED_OR_BLUE(flag, CENTER_CTF_EVENT_PASS_RED, CENTER_CTF_EVENT_PASS_BLUE), sender.netname, player.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification(tmp_player, MSG_CENTER, RED_OR_BLUE(flag, CENTER_CTF_PASS_OTHER_RED, CENTER_CTF_PASS_OTHER_BLUE), sender.netname, player.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
// create new waypoint
void ctf_Handle_Return(entity flag, entity player)
{
// messages and sounds
- //centerprint(player, strcat("You returned the ", flag.netname));
+ Send_Notification(player, MSG_CENTER, RED_OR_BLUE(flag, CENTER_CTF_EVENT_RETURN_RED, CENTER_CTF_EVENT_RETURN_BLUE), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
Send_KillNotification(player.netname, flag.netname, "", INFO_RETURNFLAG, MSG_INFO);
sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
ctf_EventLog("return", flag.team, player);
// messages and sounds
Send_KillNotification (player.netname, flag.netname, "", INFO_GOTFLAG, MSG_INFO);
sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
- verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat(Team_ColorCode(player.team), "(^7", player.netname, Team_ColorCode(player.team), ") ") : "");
-
+
FOR_EACH_REALPLAYER(tmp_player)
{
if(tmp_player == player)
{
- centerprint(tmp_player, strcat("You got the ", flag.netname, "!"));
- //if(ctf_stalemate) { centerprint(tmp_player, "Stalemate! Enemies can see you on radar!"); }
+ Send_Notification(tmp_player, MSG_CENTER, RED_OR_BLUE(flag, CENTER_CTF_EVENT_PICKUP_RED, CENTER_CTF_EVENT_PICKUP_BLUE), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ if(ctf_stalemate) { Send_Notification(player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); }
}
- //else if(!IsDifferentTeam(tmp_player, player))
- // centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!"));
- else if(!IsDifferentTeam(tmp_player, flag))
- centerprint(tmp_player, strcat("The ", Team_ColorCode(player.team), "enemy ", verbosename, "^7got your flag! Retrieve it!"));
+ else if(!IsDifferentTeam(tmp_player, player) && tmp_player != player)
+ Send_Notification(tmp_player, MSG_CENTER, (tmp_player.PICKUP_TEAM_VERBOSE ? CENTER_CTF_EVENT_PICKUP_TEAM_VERBOSE : CENTER_CTF_EVENT_PICKUP_TEAM), Team_ColorCode(player.team), (tmp_player.PICKUP_TEAM_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ else if(IsDifferentTeam(tmp_player, player))
+ Send_Notification(tmp_player, MSG_CENTER, (tmp_player.PICKUP_ENEMY_VERBOSE ? CENTER_CTF_EVENT_PICKUP_ENEMY_VERBOSE : CENTER_CTF_EVENT_PICKUP_ENEMY), Team_ColorCode(player.team), (tmp_player.PICKUP_ENEMY_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
// scoring
{
FOR_EACH_REALPLAYER(tmp_entity)
if(tmp_entity.flagcarried)
- centerprint(tmp_entity, "Stalemate! Enemies can now see you on radar!");
+ Send_Notification(tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else
- centerprint(tmp_entity, "Stalemate! Flag carriers can now be seen by enemies on radar!");
+ Send_Notification(tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_OTHER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
wpforenemy_announced = TRUE;
}
{
if(clienttype(head) == CLIENTTYPE_BOT)
{
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ Send_Notification(player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
ctf_Handle_Throw(head, player, DROP_PASS);
}
else
{
- centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname));
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ Send_Notification(head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification(player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
player.throw_antispam = time + autocvar_g_ctf_pass_wait;
return TRUE;
}
else
{
- centerprint(player, strcat("Too many flag throws, throwing disabled for ", ftos(rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time)), " seconds."));
+ Send_Notification(player, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, NO_STR_ARG, NO_STR_ARG, rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time), NO_FL_ARG, NO_FL_ARG);
return FALSE;
}
}
return TRUE;
}
+MUTATOR_HOOKFUNCTION(ctf_GetCvars)
+{
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_TEAM_VERBOSE, "notification_CENTER_CTF_EVENT_PICKUP_TEAM_VERBOSE");
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_ENEMY_VERBOSE, "notification_CENTER_CTF_EVENT_PICKUP_ENEMY_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
{