unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Counter Strike

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2006, 07:49 AM
zero_tolerance zero_tolerance is offline
Senior Member
 
Join Date: Dec 2006
Posts: 289
Default Counter-Strike OpenGL Tutorial Part 3

By DoraTehExploda

Code:
/*

  Now, we are going to do something pretty simple... We are going to add nosky, nosmoke, noflash, and noscope this time.. 
  So, lets add these bools at the top of our project...

  bool bSky = false;
  bool bSmoke = false;
  bool bFlash = false;
  bool bDrawingScope = false;
  bool sky = false;
  bool smoke = false;
  bool flash = false;
  bool scope = false;
  static GLint     vp[4];

*/

/*

  Now, lets head down to glBegin and add the code...

*/


//Simply add these like you did the rest of the code you have done up to now...

//Smoke Removal
if(smoke == true) 
{
	GLfloat smokecol[4]; 
    (*glGetFloatv)(GL_CURRENT_COLOR, smokecol); 
	if((smokecol[0]==smokecol[1]) && (smokecol[0]==smokecol[2]) && (smokecol[0]!=0.0) && (smokecol[0]!=1.0)) 
	{
		bSmoke=true;
	}
	else
	{
		bSmoke=false; 
    }
}

//Sky Removal
if (mode == GL_QUADS && nosky)
bSky = true;
else
bSky = false;

//Flash Removal
if(flash)
{
	GLfloat flashcol[4];
	(*orig_glGetFloatv)(GL_CURRENT_COLOR, flashcol);
	if(flashcol[0]==1.0 && flashcol[1]==1.0 && flashcol[2]==1.0)
		bFlash=true;
	else
		bFlash=false;
}

//Scope Removal
if(scope)
{
	GLfloat curcol[4];
	(*orig_glGetFloatv)(GL_CURRENT_COLOR, curcol);
	if ( (curcol[0]==curcol[1] && curcol[0]==curcol[2]) && (curcol[0]==0.0 || curcol[0]==1.0)&&  curcol[3]==1.0)
		bDrawingScope = true;
	else
		bDrawingScope = false;
	if (bDrawingScope) glColor4f(curcol[0],curcol[1],curcol[2],0.0f);
}


/*

  Well, that is just the beginning of it, now we have to head down to glVertex3fv and hook some other functions to get the
  sky and smoke removal to work correctly...

*/

//Smoke Removal
if(bSmoke==true && smoke == true)
{
	return;
}

//Sky Removal
if(bSky)
{
	return;
}

/*

  Head on down to glVertex2f and also add this for noflash..

*/

if(bFlash)
{
	if (y==vp[3])
    {
		GLfloat fcurcol[4];
        glGetFloatv(GL_CURRENT_COLOR, fcurcol);
        glColor4f(fcurcol[0],fcurcol[1],fcurcol[2],0.01f);
        bFlash=false;
     }
}

/* 

  Head on down to glViewport and add this also..

*/

glGetIntegerv(GL_VIEWPORT,vp);

/*

  Now, head down to glClear, and above the mask code we did earlier, add this..

*/

glClearColor ( 0, 0, 0, 0 );

/*

  Well, that sums up my 3rd tutorial. Tomorrow I will write a few more and hopefully have a good number of you actually
  working on your own basehook's and adding your own stuff. Hope everyone enjoyed this..

  DoraTehExploda

*/
This is the third tutorial.. I hope everyone thus far has understood everything thats been going on... As I start to learn more about what each function does and what not, I will be sure to comment more on the functions and everything to describe what they do.. It's 5 a.m. and I am exhausted.. So, today, when I wake up of course, there will be plenty more tutorials to come.. Until then, later and take it easy....

Credits -> Kalvin for helping me setup alot of this in the correct places and modifying some of the tutorial..
Panzer -> pGLBaseHook2 for the removal code.

Garrett
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
counterstrike, opengl, tutorial

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:56 PM.