float cap_record = ctf_captimerecord;
float cap_time = (time - flag.ctf_pickuptime);
string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
+ string player_cname = playername(player.netname, player.team, autocvar_g_chat_teamcolors);
// notify about shit
if(ctf_oneflag)
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CTF_CAPTURE_NEUTRAL, player.netname);
else if(!ctf_captimerecord)
- Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_TIME), player.netname, TIME_ENCODE(cap_time));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_TIME), player_cname, TIME_ENCODE(cap_time));
else if(cap_time < cap_record)
- Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_BROKEN), player.netname, refername, TIME_ENCODE(cap_time), TIME_ENCODE(cap_record));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_BROKEN), player_cname, refername, TIME_ENCODE(cap_time), TIME_ENCODE(cap_record));
else
- Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_UNBROKEN), player.netname, refername, TIME_ENCODE(cap_time), TIME_ENCODE(cap_record));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_NUM(flag.team, CHOICE_CTF_CAPTURE_UNBROKEN), player_cname, refername, TIME_ENCODE(cap_time), TIME_ENCODE(cap_record));
// write that shit in the database
if(!ctf_oneflag) // but not in 1-flag mode
{
// declarations
player = (player ? player : flag.pass_sender);
+ string player_cname = playername(player.netname, player.team, autocvar_g_chat_teamcolors);
// main
set_movetype(flag, MOVETYPE_TOSS);
flag.ctf_status = FLAG_DROPPED;
// messages and sounds
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_NUM(flag.team, INFO_CTF_LOST), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_NUM(flag.team, INFO_CTF_LOST), player_cname);
_sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
ctf_EventLog("dropped", player.team, player);
void ctf_Handle_Return(entity flag, entity player)
{
+ string player_cname = playername(player.netname, player.team, autocvar_g_chat_teamcolors);
+
// messages and sounds
if(IS_MONSTER(player))
{
else if(flag.team)
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_NUM(flag.team, CENTER_CTF_RETURN));
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(flag.team, INFO_CTF_RETURN), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(flag.team, INFO_CTF_RETURN), player_cname);
}
_sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
ctf_EventLog("return", flag.team, player);
{
// declarations
float pickup_dropped_score; // used to calculate dropped pickup score
+ string player_cname = playername(player.netname, player.team, autocvar_g_chat_teamcolors);
// attach the flag to the player
flag.owner = player;
}
// messages and sounds
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_NUM(flag.team, INFO_CTF_PICKUP), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_NUM(flag.team, INFO_CTF_PICKUP), player_cname);
if(ctf_stalemate)
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER);
if(!flag.team)
float kill_count_to_attacker, kill_count_to_target;
bool notif_anonymous = false;
string attacker_name = attacker.netname;
+
+ // Colorize names
+ string targ_cname = playername(targ.netname, targ.team, autocvar_g_chat_teamcolors);
+ string attacker_cname = playername(attacker.netname, attacker.team, autocvar_g_chat_teamcolors);
// Set final information for the death
targ.death_origin = targ.origin;
if (MUTATOR_CALLHOOK(ClientObituary, inflictor, attacker, targ, deathtype, attacker.(weaponentity))) { CS(targ).killcount = 0; return; }
notif_anonymous = M_ARGV(5, bool);
- if(notif_anonymous)
+ if(notif_anonymous) {
attacker_name = "Anonymous player";
+ attacker_cname = "Anonymous player";
+ }
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(
{
if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
{
- Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ_cname, deathlocation, "", targ.team, 0, 0);
}
else
{
{
case DEATH_MIRRORDAMAGE:
{
- Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ_cname, deathlocation, "", CS(targ).killcount, 0, 0);
break;
}
case DEATH_HURTTRIGGER:
- Obituary_SpecialDeath(targ, false, deathtype, targ.netname, inflictor.message, deathlocation, CS(targ).killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ_cname, inflictor.message, deathlocation, CS(targ).killcount, 0, 0);
break;
default:
{
- Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ_cname, deathlocation, "", CS(targ).killcount, 0, 0);
break;
}
}
}
}
- else if (!Obituary_WeaponDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0))
+ else if (!Obituary_WeaponDeath(targ, false, deathtype, targ_cname, deathlocation, "", CS(targ).killcount, 0))
{
backtrace("SUICIDE: what the hell happened here?\n");
return;
Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker_name);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker_name, deathlocation, CS(targ).killcount);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ_cname, attacker_cname, deathlocation, CS(targ).killcount);
// In this case, the death message will ALWAYS be "foo was betrayed by bar"
// No need for specific death/weapon messages...
if(deathtype == DEATH_BUFF.m_id)
f3 = buff_FirstFromFlags(attacker).m_id;
- if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker))
- Obituary_SpecialDeath(targ, true, deathtype, targ.netname, attacker_name, deathlocation, CS(targ).killcount, kill_count_to_attacker, f3);
+ if (!Obituary_WeaponDeath(targ, true, deathtype, targ_cname, attacker_cname, deathlocation, CS(targ).killcount, kill_count_to_attacker))
+ Obituary_SpecialDeath(targ, true, deathtype, targ_cname, attacker_cname, deathlocation, CS(targ).killcount, kill_count_to_attacker, f3);
}
}
case DEATH_HURTTRIGGER:
{
Obituary_SpecialDeath(targ, false, deathtype,
- targ.netname,
+ targ_cname,
inflictor.message,
deathlocation,
CS(targ).killcount,
case DEATH_CUSTOM:
{
Obituary_SpecialDeath(targ, false, deathtype,
- targ.netname,
+ targ_cname,
((strstrofs(deathmessage, "%", 0) < 0) ? strcat("%s ", deathmessage) : deathmessage),
deathlocation,
CS(targ).killcount,
default:
{
- Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", CS(targ).killcount, 0, 0);
+ Obituary_SpecialDeath(targ, false, deathtype, targ_cname, deathlocation, "", CS(targ).killcount, 0, 0);
break;
}
}