←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

BattleField2
Hud bf2, jak na kogos patrzymy-pomoc

  • +
  • -
sebo97 - zdjęcie sebo97 29.07.2013

Witam, mam taki kod w hud.inl

 

public DisplayHUD(id)

{
id -= TASK_HUD;
 
if ( !get_pcvar_num(gPcvarBF2Active) || !get_pcvar_num(gPcvarStatusText) )
return PLUGIN_CONTINUE;
if ( !is_user_alive(id) || is_user_bot(id) )
return PLUGIN_CONTINUE;
 
if(!is_user_connected(id))
{
remove_task(id+TASK_HUD);
return PLUGIN_CONTINUE;
}
 
 
if ( !gStatsLoaded[id] )
{
set_hudmessage(0, 128, 0, 0.05, 0.24, 0, 0.0, 0.2, 0.0, 0.0, 2)
ShowSyncHudMsg(id, gHUD,"[%s] Wczytuje Dane...", gPluginName)
}
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));
 
new nazwa_gracza[33][64];
get_user_name(id, nazwa_gracza[id], 63);
 
if(!is_user_alive(id))
{
new target = pev(id, pev_iuser2);
if(!target)
return PLUGIN_CONTINUE;
set_hudmessage(255, 237, 255, 0.6, -1.0, 0, 0.0, 0.2, 0.0, 0.0, 2);
ShowSyncHudMsg(id, gHUD,"[%s]^nNick : %s^nRanga: %s^nIlosc Odznak: %d/32^nZabicia: %d/%d", gPluginName, nazwa_gracza[target], gRankName[rank], numofbadges[target], totalkills[target], nextrankxp);
return PLUGIN_CONTINUE;
}
else {
set_hudmessage(0, 128, 0, 0.05, 0.24, 0, 0.0, 0.2, 0.0, 0.0, 2)
ShowSyncHudMsg(id, gHUD,"[%s]^nNick : %s^nRanga: %s^nIlosc Odznak: %d/32^nZabicia: %d/%d", gPluginName, nazwa_gracza[id], gRankName[rank], numofbadges[id], totalkills[id], nextrankxp);
return PLUGIN_CONTINUE;
}
}
}
 
I jak patrze na kogos to nic się nie wyświetla, próbowałem na podstawie coda zrobić, ale coś mi nie wyszło, proszę o pomoc :)
Odpowiedz

  • +
  • -
City - zdjęcie City 29.07.2013

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();
}
Odpowiedz

  • +
  • -
sebo97 - zdjęcie sebo97 29.07.2013

Kompletnie nie o to mi chodziło... wiesz jak działa hud w codzie? TO chce na takiej samej zasadzie..

 

@edit podałeś kod jaki miałem na początku, zanim go zacząłem edytować...


Użytkownik sebo97 edytował ten post 29.07.2013 16:11
Odpowiedz