Open your Client.cpp find this
Code:
HSPRITE ch_sniper=-1, sniper_scope=-1
void drawCrosshair();
replace it all with following:
Code:
HSPRITE ch_sniper=-1, sniper_scope=-1;
void drawCrosshair()
{
if( me.inZoomMode ) { return; }
int centerX = displayCenterX;
int centerY = displayCenterY;
ColorEntry* clr = colorList.get(0);
int r=clr->r, g=clr->g, b=clr->b, a=clr->a;
switch(cvar.cross)
{
case 1:
gEngfuncs.pfnFillRGBA(centerX - 14, centerY, 9, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX +5, centerY, 9, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY - 14, 1, 9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY + 5, 1, 9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY , 1, 1,r,g,b,a);
break;
case 2:
gEngfuncs.pfnFillRGBA(centerX - 14, centerY, 9,2,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX +6, centerY, 9,2,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY - 14, 2,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY + 7, 2,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX, centerY , 2,2,r,g,b,a);
break;
case 3:
gEngfuncs.pfnFillRGBA(centerX-25,centerY,50,1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY-25,1,50,r,g,b,a);
break;
case 4:
gEngfuncs.pfnFillRGBA(centerX-25,centerY,50,2,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY-25,2,50,r,g,b,a);
break;
case 5:
gEngfuncs.pfnFillRGBA(centerX, centerY , 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 1, centerY + 1, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 2, centerY + 2, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 3, centerY + 3, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 5, centerY + 5, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 6, centerY + 6, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 7, centerY + 7, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 8, centerY + 8, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 9, centerY + 9, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 10, centerY + 10, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 11, centerY + 11, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 12, centerY + 12, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 13, centerY + 13, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 14, centerY + 14, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 15, centerY + 15, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 1, centerY - 1, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 2, centerY - 2, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 3, centerY - 3, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX - 5, centerY - 5, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 6, centerY - 6, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 7, centerY - 7, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 8, centerY - 8, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 9, centerY - 9, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 10, centerY - 10, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 11, centerY - 11, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 12, centerY - 12, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 13, centerY - 13, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 14, centerY - 14, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 15, centerY - 15, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 1, centerY + 1, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 2, centerY + 2, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 3, centerY + 3, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 5, centerY + 5, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 6, centerY + 6, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 7, centerY + 7, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 8, centerY + 8, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 9, centerY + 9, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 10, centerY + 10, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 11, centerY + 11, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 12, centerY + 12, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 13, centerY + 13, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 14, centerY + 14, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 15, centerY + 15, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 1, centerY - 1, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 2, centerY - 2, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 3, centerY - 3, 1, 1,255,0,0,255);
gEngfuncs.pfnFillRGBA(centerX + 5, centerY - 5, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 6, centerY - 6, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 7, centerY - 7, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 8, centerY - 8, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 9, centerY - 9, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 10, centerY - 10, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 11, centerY - 11, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 12, centerY - 12, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 13, centerY - 13, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 14, centerY - 14, 1, 1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 15, centerY - 15, 1, 1,r,g,b,a);
break;
case 6:
if(ch_sniper!=-1){
gEngfuncs.pfnSPR_Set(ch_sniper,255,255,255);
gEngfuncs.pfnSPR_DrawHoles(0,displayCenterX-128,displayCenterY-128,NULL);
}
break;
case 7:
if(sniper_scope!=-1){
gEngfuncs.pfnSPR_Set(sniper_scope,255,255,255);
gEngfuncs.pfnSPR_DrawHoles(0,displayCenterX-128,displayCenterY-128,NULL);
}
break;
case 8:
gEngfuncs.pfnFillRGBA(0,centerY,2*centerX,1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,0,1,2*centerY,r,g,b,a);
break;
case 9:
gEngfuncs.pfnFillRGBA(centerX - 14,centerY,9,2,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 5 ,centerY,9,2,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 14,centerY,9,-1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 5 ,centerY,9,-1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY - 14,2,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY + 6 ,2,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY - 14,-1,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY + 6 ,-1,9,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX - 3,centerY,1,1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX + 3,centerY,1,1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY - 3,1,1,r,g,b,a);
gEngfuncs.pfnFillRGBA(centerX,centerY + 3,1,1,r,g,b,a);
break;
}
}
next in your Code:
HUD_Redraw
under line hudDrawInfoTexts();
add this
Code:
if (cvar.cross) { drawCrosshair (); }
then register your cvars
cvar.cpp
Code:
REGISTER_CVAR_INT( cross ,1)
cvar.h Code:
int cross;