Il vous faut le sound esp pour que ce code marche
Ce code a été inspiré du code de Mike
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
Client.cpp
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
Cherchez
Code:
PreS_DynamicSound
Et mettez y :
Code:
string theMessage7;
string theMessage8;
string theMessage9;
size_t length8;
size_t length9;
size_t length10;
if(b>0 && b<=36)
{
theMessage7 = vPlayers.entinfo.name;
theMessage8 = vPlayers.entinfo.name;
theMessage9 = vPlayers.entinfo.name;
length8 = theMessage7.length();
length9 = theMessage8.length();
length10 = theMessage9.length();
ref.team = vPlayers[ax].team;
}
if (cvar.hitinfo)
{
if(strstr(sample,"player/bhit_flesh-1"))
{
theMessage8+=" a recu une balle (Flesh) !";
gSetHudMessage5(theMessage8.c_str());
}
if(strstr(sample,"player/bhit_flesh-2"))
{
theMessage8+=" a recu une balle (Flesh) !";
gSetHudMessage5(theMessage8.c_str());
}
if(strstr(sample,"player/bhit_flesh-3"))
{
theMessage8+=" a recu une balle (Flesh) !";
gSetHudMessage5(theMessage8.c_str());
}
if(strstr(sample,"player/bhit_helmet-1"))
{
theMessage8+=" a recu une balle (Casque) !";
gSetHudMessage5(theMessage8.c_str());
}
if(strstr(sample,"player/bhit_kevlar-1"))
{
theMessage8+=" a recu une balle (Gilet) !";
gSetHudMessage5(theMessage8.c_str());
}
}
Ensuite cherchez :
Code:
void AtRoundStart(void)
Et mettez au dessus :
Code:
static void ClearHudInfo()
{
if(cvar.hitinfo)
{
gSetHudMessage5(" ");
gSetHudMessage5(" ");
gSetHudMessage5(" ");
gSetHudMessage5(" ");
}
}
Et puis dans :
Code:
void AtRoundStart(void)
Mettez :
Code:
ClearHudInfo();
Dans le
Code:
void HUD_Redraw(int x, int y)
Mettez :
Code:
if(cvar.soundfilter>0 && cvar.hitinfo)
{
int xxa = 20;
int yya = 338;
DrawGlowString(xxa,yya,0, 0, 128,"Hit Info:");
int xxb = 20;
int yyb = 354;
ColorEntry* clrf = colorList.get(38);
DrawHudString(xxb, yyb, clrf->r, clrf->g, clrf->b,
gHudMessage5[indexRedirect4[0]]);
int xxc = 20;
int yyc = 370;
ColorEntry* clra = colorList.get(39);
DrawHudString(xxc, yyc, clra->r, clra->g, clra->b,
gHudMessage5[indexRedirect4[1]]);
int xxd = 20;
int yyd = 386;
ColorEntry* clrb = colorList.get(40);
DrawHudString(xxd, yyd, clrb->r, clrb->g, clrb->b,
gHudMessage5[indexRedirect4[2]]);
int xxe = 20;
int yye = 402;
ColorEntry* clrc = colorList.get(41);
DrawHudString(xxe, yye, clrc->r, clrc->g, clrc->b,
gHudMessage5[indexRedirect4[3]]);
}
Cherchez :
Code:
string getOgcDirFile(const char* basename)
{
if(strstr(basename,"..")){ return ":*?\\/<>\""; }
string ret = ltfxdir;
return (ret+basename);
}
Et mettez dessous :
Code:
// Hit Info Message
char gHudMessage5[4][256] = { "","","","" }; //allow up to four messages
StopTimer gHudTimer5;
int indexRedirect4[4] = { 0,1,2,3 }; // a "hack" way to scroll list without copying strings
int duration4;
void gSetHudMessage5(const char* message)
{
int dest = indexRedirect4[0];
indexRedirect4[0] = indexRedirect4[1];
indexRedirect4[1] = indexRedirect4[2];
indexRedirect4[2] = indexRedirect4[3];
indexRedirect4[3] = dest;
strcpy(gHudMessage5[dest],message);
gHudTimer5.countdown(duration4);
}
Déclarez votre CVAR et si vous avez des problèmes demandez dans la partie Aide