Release Simple External Crosshair
#1
Simple External Crosshair


Title Says it all, It is a very good example for people who are beginners in C++ and can be used in any game since its external.

I have left Sleep(); as (33) which is most common Frames Per Second in FPS games I think. Make sure to change the RGB to your likings for different colours.

Credits:
Hell_Demon

Code:
#include <windows.h> #include <iostream> #include <math.h> using namespace std; bool crosshairon=false; HDC ragedc = NULL; int crosshairsize=0; int cx=0; int cy=0; void CrossThread(void) { while(1) { if(GetAsyncKeyState(VK_NUMPAD0)&1) { crosshairon=!crosshairon; ragedc = GetDC(HWND_DESKTOP); cx=GetSystemMetrics(SM_CXSCREEN)/2-((crosshairsize-1)/2); cy=GetSystemMetrics(SM_CYSCREEN)/2-((crosshairsize-1)/2); } Sleep(1); } } int main() { cout<<"Crosshair size in pixels:\n"; cin>>crosshairsize; if(crosshairsize%2==0) { crosshairsize+=1; } system("cls"); cout<<"Press numpad0 to toggle the crosshair on and off\n"; CreateThread(0,0,(LPTHREAD_START_ROUTINE)CrossThread,0,0,0); while(1) { if(crosshairon==true) { for(int i=0;i<crosshairsize;i++) { SetPixel(ragedc, cx+i, cy+((crosshairsize-1)/2), RGB(255,0,0)); SetPixel(ragedc, cx+((crosshairsize-1)/2), cy+i, RGB(0,0,255)); } if(crosshairon==false) for(int i=1;i<crosshairsize;i++) { SetPixel(ragedc, cx+i, cy+((crosshairsize-1)/2), RGB(0,0,0)); SetPixel(ragedc, cx+((crosshairsize-1)/2), cy+i, RGB(0,0,0)); } } Sleep(33); } }

Thanks and +Rep If you like it. Also added the .exe file

#2
thanks but i have a question, im noob in source things but how do i activate or let the crosshair work on any game?

#3
Press numpad 0 Big Grin

#4
Thanks, i give u thanked Big Grin



Possibly Related Threads…
Thread Author Replies Views Last Post
  Dedicated Server External (public) IP Nerus 3 9,646 11-02-2013, 14:16
Last Post: Casper
  Help MW3 (External) Console - TeknoMW3? Strazeeh 7 10,990 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 5,975 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 7,844 09-26-2013, 18:02
Last Post: Rendflex
  [Release] Black Ops 1 "External" Console barata 16 26,692 07-19-2013, 21:15
Last Post: Jakeyellis
  Black Ops 1 External Console meowgasm 8 13,644 07-04-2013, 00:57
Last Post: Nekochan
  Simple flyable helicopter script port, could use help! akillj 0 3,742 06-15-2013, 09:20
Last Post: akillj
  Black ops 1 External console/Dvar unlocker Jakeyellis 10 14,655 05-05-2013, 13:00
Last Post: barata
  [Release] Simple Math Commands Yamato 10 11,118 01-28-2013, 12:59
Last Post: Yamato
  [Tutorial] Making A Simple Calculator! Ivankec 4 10,337 12-14-2012, 19:22
Last Post: Gam3rr0rZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.