Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -----------------------------------------
- * Game hacking QTS ( Quickie Tip Series )
- * no. 20 - Statistics ( Frames per second, Client size, Date & Time )
- -----------------------------------------
- * Author: SEGnosis - GHAnon.net
- * Thanks to:
- * bitterbanana - No known site
- * Drunken Cheetah - No known site
- * fatboy88 - No known site
- * Geek4Ever - No known site
- * learn_more - www.uc-forum.com
- * Novocaine - http://ilsken.net/blog/?page_id=64
- * Philly0494 - No known site
- * Roverturbo - www.uc-forum.com
- * SilentKarma - www.halocoders.com - offline
- * Strife - www.uc-forum.com
- * Wieter20 - No known site
- */
- #include <time.h>
- //----------------------------------//
- //Client stats
- D3DVIEWPORT9 pViewPort;
- pDevice->GetViewport( &pViewPort );
- CDraw.String( 10, 10, CDraw.m_coRed, FF_DEFAULT, "Screen Width: %d Height: %d", pViewPort.Width, pViewPort.Height );
- //----------------------------------//
- // Date and time
- time_t rawtime;
- struct tm * timeinfo;
- time ( &rawtime );
- timeinfo = localtime( &rawtime );
- CDraw.String( 10, 30, CDraw.m_coRed, FF_DEFAULT, asctime (timeinfo) );
- //----------------------------------//
- // Frames per second
- static float fLastTime = GetTickCount(),
- fCurrentTime = GetTickCount();
- static float fFramesPerSecond = 0,
- fTotal = 0,
- fAverage = 0;
- fCurrentTime = GetTickCount();
- fTotal = ( fFramesPerSecond + 0.1f ) / ( ( fCurrentTime - fLastTime )/1000 );
- if( fCurrentTime - fLastTime > 5000 )
- {
- fLastTime = fCurrentTime;
- fFramesPerSecond = 0;
- fAverage = fTotal;
- }
- CDraw.String( 10, 40, CDraw.m_coRed, FF_DEFAULT, "FPS: %f", ( fTotal == 0 ? fAverage : fTotal ) );
- fFramesPerSecond++;
- //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement