//Bf2 Rank Mod HUD File
//Contains all the HUD functions.
#if defined bf2_hud_included
#endinput
#endif
#define bf2_hud_included
//Show an announcement display
public Announcement(id)
{
if ( !get_pcvar_num(gPcvarBF2Active) || is_user_bot(id) ) return;
#if defined KOLOROWY_SAY
ColorChat(id,TEAM_COLOR,"[BF2]^x03 Ten serwer uzywa^x04 %s.^x03 Wpisz^x04 ^"/bf2menu^"^x03 aby uzyskac wiecej informacji", gPluginName);
#else
client_print(id, print_chat, "[BF2] Ten serwer uzywa %s. Wpisz ^"/bf2menu^" aby uzyskac wiecej informacji", gPluginName);
#endif
}
//Displays the HUD to the user
public DisplayHUD(id)
{
if ( !get_pcvar_num(gPcvarBF2Active) || !get_pcvar_num(gPcvarStatusText) ) return;
if ( !is_user_alive(id) || is_user_bot(id) ) return;
static HUD[64];
if ( !gStatsLoaded[id] )
{
formatex(HUD, charsmax(HUD), "[BF2] Wczytuje Dane...");
}
else
{
new rank = g_PlayerRank[id];
new nextrank;
switch(rank)
{
case 16, 19, 20, 21: nextrank = 15;
case 17: nextrank = 7;
case 18: nextrank = 8;
default: nextrank = rank;
}
++nextrank;
new nextrankxp = floatround(gRankXP[nextrank] * get_pcvar_float(gPcvarXpMultiplier));
if ( !get_pcvar_num(gPcvarBadgesActive) )
{
formatex(HUD, charsmax(HUD), "[BF2] Zabicia: %d/%d Ranga: %s", totalkills[id], nextrankxp, gRankName[rank]);
}
else
{
formatex(HUD, charsmax(HUD), "[BF2] Zabicia: %d/%d Odznaki: %d Ranga: %s", totalkills[id], nextrankxp, numofbadges[id], gRankName[rank]);
}
}
message_begin(MSG_ONE_UNRELIABLE, gmsgStatusText, _, id);
write_byte(0);
write_string(HUD);
message_end();
}