Jump to content

Featured Replies

Posted

Well, there are probably a lot of people like me who are trying to get started, but just can't find a good tutorial.

 

Well, to start off your going to need to have an OpenGL wrapper. This basically is like a middle man, best illustrated below:

 

Game - > Calls OpenGL Function -> Calls OpenGL Wrapper -> Calls OpenGL itself

 

The wrapper allows you to make additions to the function called, such as Disabling blending in a wallhack.

 

So, onto making the wallhack.

 

First of all, your going to want to scroll down to the glBegin function. This function is called A LOT. This is what is called before drawing walls, models, guns etc. So, what your going to want to do here is check to see what is being drawn. The paramater sent into glBegin is "mode". This will tell you what is being drawn. Players in COUNTER-STRIKE 1.6 are drawn using the mode GL_TRIANGLES_FAN and GL_TRIANGLE_STRIP. What this means is that if we want to make the walls See-Through, we have to check to make sure this is not being drawn. This code is fairly simple and can be done as follows:

 

if(!(mode == GL_TRIANGLE_STRIP || mode == GL_TRIANGLE_FAN)))

 

So, this means that if Counter-Strike is drawing a wall, do the following.

 

For a simple wallhack, you can just disable DEPTH_TEST. What this means is that it no longer checks to see if the wall is in front of the player. This can be done as follows:

 

glDisable(GL_DEPTH_TEST);

 

Now we are disabling the depth testing and you can see through walls :D

 

For some people, you may have to Enable depth testing if its not a wall, which is done as follows:

 

else
     glEnable(GL_DEPTH_TEST);

 

Now after doing these, you let your wrapper call the real glBegin and your wallhack is done!

 

Finished code:

 

if(!(mode==GL_TRIANGLE_STRIP||mode==GL_TRIANGLE_FAN))
    glDisable(GL_DEPTH_TEST);
else
    glEnable(GL_DEPTH_TEST);

//glBegin true method

 

http://www.ccoders.cproj.com

Guest
This topic is now closed to further replies.