int x_dif, y_dif; int RadarX = sT.refdef->width - 205; int RadarY = 5; bool MovingRadar = false; bool MovingStats = false; //////////////////////////////////////////////////////////////////////////////////////////////// // Radar void DRAWING::DrawRadar() { vec3_t vec,rot; float distance; float screen[2]; if( MovingRadar ) { RadarX = Gb.CursorX - x_dif; RadarY = Gb.CursorY - y_dif; } if( M.Radar == 1 ) { DrawRect( RadarX, RadarY, 200, 200, 100, r_black ); DrawRect( RadarX, RadarY, 200, 200, 1, r_white ); DrawRect( RadarX + 1, RadarY + 100, 198, 1, 1, r_gray ); DrawRect( RadarX + 100, RadarY + 1, 1, 198, 1, r_gray ); // Player Locations for( int i=0; i<64; i++ ) { if( sT.cent[i].currentValid && sT.cent[i].currentState.clientNum != sT.cg->clientNum ) { VectorSubtract( sT.cent[i].lerpOrigin,sT.refdef->viewOrg,vec ); distance=w2s.VectorLength(vec)*0.012; w2s.VectorAngles( vec,rot ); rot[1]=w2s.AngleNormalize180( rot[1] - sT.refdef->refdefViewAngles[1] ); rot[0]=w2s.AngleNormalize180( rot[0] - sT.refdef->refdefViewAngles[0] ); rot[2]=w2s.AngleNormalize180( rot[2] - sT.refdef->refdefViewAngles[2] ); w2s.AngleVectors( rot,vec,0,0 ); VectorScale( vec,distance,vec ); if( vec[0]>100.0f ) VectorScale( vec,100.0f/vec[0],vec ); else if( vec[0]<-100.0f ) VectorScale( vec,-100.0f/vec[0],vec ); if( vec[1]>100.0f ) VectorScale(vec,100.0f/vec[1],vec); else if( vec[1]<-100.0f ) VectorScale(vec,-100.0f/vec[1],vec); screen[0]=-vec[1] + ( RadarX + 100 ); screen[1]=-vec[0] + ( RadarY + 100 ); if( ( screen[0] > ( sT.refdef->width - 205 ) ) && ( screen[0] < ( sT.refdef->width - 10 ) ) && ( screen[1] < 205 ) && ( screen[1] > 10 ) ) { if( M.Aimbot != 2 ) { if( sT.cli[sT.cent[i].currentState.clientNum].team == sT.cli[sT.cg->clientNum].team ) { Draw.DrawString( ".", screen[0], screen[1], 1, Gb.font[1], .01, 1, 0, 1 ); } else if( sT.cli[sT.cent[i].currentState.clientNum].team != sT.cli[sT.cg->clientNum].team ) { Draw.DrawString( ".", screen[0], screen[1], 1, Gb.font[1], 1, 0, 0, 1 ); } } else if( M.Aimbot == 2 ) { if( sT.cli[sT.cent[i].currentState.clientNum].team == sT.cli[sT.cg->clientNum].team ) { Draw.DrawString( ".", screen[0], screen[1], 1, Gb.font[1], 1, 0, 0, 1 ); } else if( sT.cli[sT.cent[i].currentState.clientNum].team != sT.cli[sT.cg->clientNum].team ) { Draw.DrawString( ".", screen[0], screen[1], 1, Gb.font[1], 1, 0, 0, 1 ); } } } } } } MovingRadar = false; if( Draw.CursorOnButton( Gb.CursorX, Gb.CursorY, RadarX, RadarY, 200, 200 ) && GetAsyncKeyState( VK_LBUTTON ) ) { x_dif = Gb.CursorX - RadarX; y_dif = Gb.CursorY - RadarY; MovingRadar = true; } }