unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > First-Person Shooters > Other FPS Games > Half Life

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


Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2007, 04:00 PM
Neo_Reloaded Neo_Reloaded is offline
Tutorial Admin
 
Join Date: Dec 2006
Posts: 259
Default Draw your ESP using less looping (only for OGC)

By CrazyLord

You might have noticed that OGC uses double calculations and loops, while you loop trough the different available entities in HUD_Redraw you do the exact same to draw your vectors.

Both use something similar:

Code:
for (int i=0; i<vPlayers.size();i++) { /* Drawing */ }
What you can do is basically remove your DrawPlayerEsp function (if it's called like that), and draw it in the Draw_Player_Vecs (since i'm sure that's what you use). You will have to convert the 3D coordinates to 2D to be able to draw your ESP, for this you can use CalcScreen. The function i use looks like this:

Code:
bool drawStringAtCoords(float *input, int r, int g, int b, const char* temp) {
	float vecScreen[2];
	if (CalcScreen(input, vecScreen)) {
		drawStringCenter(vecScreen[0], vecScreen[1], r, g, b, temp);
		return true;
	}
	else
		return false;
}
It's easy to use and it saves you 32 calculations each time your hud_redraw function get's called
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
draw, esp, looping, ogc

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:19 PM.