string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
{
- local float nPlayerHealth = rint(enPlayer.health);
- local float nPlayerArmor = rint(enPlayer.armorvalue);
- local float nPlayerHandicap = enPlayer.cvar_cl_handicap;
- local float nPlayerPing = rint(enPlayer.ping);
- local string strPlayerPingColor;
- local string strMessage;
+ float nPlayerHealth = rint(enPlayer.health);
+ float nPlayerArmor = rint(enPlayer.armorvalue);
+ float nPlayerHandicap = enPlayer.cvar_cl_handicap;
+ float nPlayerPing = rint(enPlayer.ping);
+ string strPlayerPingColor;
+ string strMessage;
+
if(nPlayerPing >= 150)
strPlayerPingColor = "^1";
else
strPlayerPingColor = "^2";
if((autocvar_sv_fragmessage_information_stats) && (enPlayer.health >= 1))
- strMessage = strcat(strMessage, "\n^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
+ strMessage = strcat(strMessage, "^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
if(autocvar_sv_fragmessage_information_ping) {
if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
} else if(autocvar_sv_fragmessage_information_handicap) {
if(autocvar_sv_fragmessage_information_handicap == 2)
if(nPlayerHandicap <= 1)
- strMessage = strcat(strMessage, "\n^7(Handicap ^2Off^7)");
+ strMessage = strcat(strMessage, "^7(Handicap ^2Off^7)");
else
- strMessage = strcat(strMessage, "\n^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
+ strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
else if(nPlayerHandicap > 1)
- strMessage = strcat(strMessage, "\n^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
+ strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
}
+
+ if(strMessage) // add new line to the beginning if there is a message
+ strMessage = strcat("\n", strMessage);
+
return strMessage;
}
void bcenterprint(string s)