Posted: Mon Jul 26, 2004 6:09 pm Post subject: Displaying Shield / Shield to Side
--------------------------------------------------------------------------------
This is how to make it display if they are shielded or if the shield is to the side.. It will also display Throwing,planting,and reloading. I personally like this better than a reload meter
First change you sequence info to this :
Code:
// sequence info data
int Cstrike_SequenceInfo[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0..9
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 10..19
1, 2, 0, 1, 1, 2, 0, 1, 1, 2, // 20..29
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 30..39
1, 2, 0, 1, 2, 0, 1, 2, 0, 1, // 40..49
2, 0, 1, 2, 0, 0, 0, 8, 0, 8, // 50..59
0, 5, 0, 5, 0, 0, 1, 1, 2, 0, // 60..69
1, 1, 2, 0, 1, 0, 1, 0, 1, 2, // 70..79
0, 1, 2, 32, 40, 32, 40, 32, 32, 32, // 80..89
33, 32, 33, 34, 64, 4, 34, 32, 32, 4, // 90..99
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 100..109
4 // 110
};
Then you will need to add the sequences:
Code:
enum { SEQUENCE_SHOOT=1, SEQUENCE_RELOAD=2, SEQUENCE_DIE=3, SEQUENCE_THROW=4, SEQUENCE_ARM_C4=5, SEQUENCE_SHIELD=32, SEQUENCE_SHIELD_SIDE=64 };
char* Cstrike_infotext[] = {"", "- PENG -", "- RELOADING -", "", "-THROWING -", "- ARMING C4 -", "-SHIELDED-", "SHIELD-TO-SIDE" };
Now to get it to display:
Code:
if (cvar.seqinfo)
{
int seqinfo = Cstrike_SequenceInfo[ent->curstate.sequence];
ColorEntry* seq = colorList.get(15);
if(seqinfo == 2)
{
DrawHudStringCenter(x,y,seq->r,seq->g,seq->b,"-RELOADING-");
y += ystep;
}
if (seqinfo == 8)
{
DrawHudStringCenter(x,y,seq->r,seq->g,seq->b,"-THROWING-");
y += ystep;
}
if (seqinfo == 16)
{
DrawHudStringCenter(x,y,seq->r,seq->g,seq->b,"-PLANTING-");
y += ystep;
}
if (seqinfo == 32)
{
DrawHudStringCenter(x,y,seq->r,seq->g,seq->b,"-SHIELDED-");
y += ystep;
}
if (seqinfo == 64)
{
DrawHudStringCenter(x,y,seq->r,seq->g,seq->b,"-SHIELD-TO-SIDE-");
y += ystep;
}
}