[RELEASE] Useful Functions

Posts 16–30 of 189 · Page 2 of 13
Quote Originally Posted by xXNoobAlertXx View Post
Umm swat how do you use the D3D i dont know lol
its a language just like C++ you learn it.. the question u asked me is basically the equivalent of "How Do u Use German" lol

Quote Originally Posted by ac1d_buRn View Post


LOL. Serious?

hahah ya just try putting it in your hack as a DirectX string.. it took me like 20 minutes to figure out why I was d/cing lol
If you can hook DrawIndexedPrimitive you can use these:

Code:
		

#define D3D_SKY (uiStride == 28 && NumVertices == 8 && primCount == 4) //Desert
#define D3D_SKY2 (uiStride == 28 && NumVertices == 4 && primCount == 2 ) //Urban
#define D3D_SKY3 (uiStride == 28 && NumVertices == 240 && primCount == 80 ) //Snow
#define D3D_HANDS (uiStride == 40 && NumVertices == 31 && primCount == 16 || uiStride == 40 && NumVertices == 70 && primCount == 70 || uiStride == 40 && NumVertices == 116 && primCount == 111 || uiStride == 40 && NumVertices == 23 && primCount == 11 || uiStride == 40 && NumVertices == 36 && primCount == 22 || uiStride == 40 && NumVertices == 41 && primCount == 25 || uiStride == 40 && NumVertices == 18 && primCount == 11 || uiStride == 40 && NumVertices == 20 && primCount == 11 || uiStride == 40 && NumVertices == 35 && primCount == 15 || uiStride == 40 && NumVertices == 25 && primCount == 16 || uiStride == 40 && NumVertices == 24 && primCount == 20 || uiStride == 40 && NumVertices == 49 && primCount == 54 || uiStride == 40 && NumVertices == 28 && primCount == 20 || uiStride == 40 && NumVertices == 65 && primCount == 54 || uiStride == 40 && NumVertices == 24 && primCount == 17 || uiStride == 40 && NumVertices == 58 & primCount == 52 || uiStride == 40 && NumVertices == 8 && primCount == 3 || uiStride == 40 && NumVertices == 59 && primCount == 64 || uiStride == 40 && NumVertices == 141 && primCount == 181 || uiStride == 40 && NumVertices == 55 && primCount == 61 || uiStride == 40 && NumVertices == 35 && primCount == 26 || uiStride == 40 && NumVertices == 63 && primCount == 54 || uiStride == 40 && NumVertices == 257 && primCount == 292 || uiStride == 40 && NumVertices == 305 && primCount == 364 || uiStride == 40 && NumVertices == 189 && primCount == 253 )

if( iSky == 1 )
		{
			if( D3D_SKY || D3D_SKY2 || D3D_SKY3 )
			{
				pDevice->SetTexture(0, texSky ); // FILE COLOR
				//return D3D_OK;
			}
		}
		if( iNoHands == 1 )
		{
			if( D3D_HANDS )
			{
				return D3D_OK; // REMOVAL
			}
		}
Show your FPS, not Combat Arms' engine function. I don't know who made this, I take no credit.

Code:
float       fFps               = NULL;
float       fLastTickCount     = NULL;
float       fCurrentTickCount;
char        cFrameRate[50]     = {NULL};

char *GetFrameRate()
{
	fCurrentTickCount = clock() * 0.001f;
	++fFps;
	if((fCurrentTickCount - fLastTickCount) > 1.0f)
	{
		fLastTickCount = fCurrentTickCount;
		sprintf( cFrameRate, "[ Current FPS: %d ]", int( fFps ) );
		fFps = 0;
	}
	return cFrameRate;
}

myFont->DrawTextA( 5, 0, D3DCOLOR_XRGB( 255, 250, 0 ), GetFrameRate() );
Quote Originally Posted by Synns View Post
If you can hook DrawIndexedPrimitive you can use these:

Code:
		

#define D3D_SKY (uiStride == 28 && NumVertices == 8 && primCount == 4) //Desert
#define D3D_SKY2 (uiStride == 28 && NumVertices == 4 && primCount == 2 ) //Urban
#define D3D_SKY3 (uiStride == 28 && NumVertices == 240 && primCount == 80 ) //Snow
#define D3D_HANDS (uiStride == 40 && NumVertices == 31 && primCount == 16 || uiStride == 40 && NumVertices == 70 && primCount == 70 || uiStride == 40 && NumVertices == 116 && primCount == 111 || uiStride == 40 && NumVertices == 23 && primCount == 11 || uiStride == 40 && NumVertices == 36 && primCount == 22 || uiStride == 40 && NumVertices == 41 && primCount == 25 || uiStride == 40 && NumVertices == 18 && primCount == 11 || uiStride == 40 && NumVertices == 20 && primCount == 11 || uiStride == 40 && NumVertices == 35 && primCount == 15 || uiStride == 40 && NumVertices == 25 && primCount == 16 || uiStride == 40 && NumVertices == 24 && primCount == 20 || uiStride == 40 && NumVertices == 49 && primCount == 54 || uiStride == 40 && NumVertices == 28 && primCount == 20 || uiStride == 40 && NumVertices == 65 && primCount == 54 || uiStride == 40 && NumVertices == 24 && primCount == 17 || uiStride == 40 && NumVertices == 58 & primCount == 52 || uiStride == 40 && NumVertices == 8 && primCount == 3 || uiStride == 40 && NumVertices == 59 && primCount == 64 || uiStride == 40 && NumVertices == 141 && primCount == 181 || uiStride == 40 && NumVertices == 55 && primCount == 61 || uiStride == 40 && NumVertices == 35 && primCount == 26 || uiStride == 40 && NumVertices == 63 && primCount == 54 || uiStride == 40 && NumVertices == 257 && primCount == 292 || uiStride == 40 && NumVertices == 305 && primCount == 364 || uiStride == 40 && NumVertices == 189 && primCount == 253 )

if( iSky == 1 )
		{
			if( D3D_SKY || D3D_SKY2 || D3D_SKY3 )
			{
				pDevice->SetTexture(0, texSky ); // FILE COLOR
				//return D3D_OK;
			}
		}
		if( iNoHands == 1 )
		{
			if( D3D_HANDS )
			{
				return D3D_OK; // REMOVAL
			}
		}
Show your FPS, not Combat Arms' engine function. I don't know who made this, I take no credit.

Code:
float       fFps               = NULL;
float       fLastTickCount     = NULL;
float       fCurrentTickCount;
char        cFrameRate[50]     = {NULL};

char *GetFrameRate()
{
	fCurrentTickCount = clock() * 0.001f;
	++fFps;
	if((fCurrentTickCount - fLastTickCount) > 1.0f)
	{
		fLastTickCount = fCurrentTickCount;
		sprintf( cFrameRate, "[ Current FPS: %d ]", int( fFps ) );
		fFps = 0;
	}
	return cFrameRate;
}

myFont->DrawTextA( 5, 0, D3DCOLOR_XRGB( 255, 250, 0 ), GetFrameRate() );
Cool. Thanks for them

I think hackshield is removing my DiP
Quote Originally Posted by ac1d_buRn View Post


Cool. Thanks for them

I think hackshield is removing my DiP
It most likely is.... hackshield seems to overwrite the entire DIP function every 5 minutes or so, so no matter where you hook in the function it will get taken out. And also, if you just re-hook it every frame or something, you have a high chance of getting an illegal instruction error. The best thing to do is simply find a different place to hook.
Hi, first, thank you ac1d for the functions, I have compiled them with no errors...finally, but I want to know if it is possible to load the crosshair function and show it by default without the need for a d3d menu, because I don't want one right now.

BTW, Longevity, I think I played with you yesterday in death room.
Woah. That is really interesting swatfx, I tried it and it D/Ced at the login screen. o.o
Most of these are leeched:/

Hmm, but okay. Stickied.
Quote Originally Posted by Zoom View Post
Most of these are leeched:/

Hmm, but okay. Stickied.
I said no credits to me.
There just what ive been using in my hacks and thought id share
Nice Stickied.
The DirectX string maker is also useful
Very very nice! Awesome job.
Hopefully the DirectX String Maker by CoderNever will be able to help coders out with the x, y's of these functions in V2.
For this functions to work, do I need to import something from another "base"?

Because I have only PTC commands on my hack, just a single source file, but I would love to have a d3d crosshair.

I added ac1d posted functions but as I said, it does not load a crosshair on my screen.

Don't flame me much :P
Fro universal FPS counter help me out with this error
:
1>.\Base.cpp(24) : error C3861: 'clock': identifier not found
Quote Originally Posted by ngh555 View Post
For this functions to work, do I need to import something from another "base"?

Because I have only PTC commands on my hack, just a single source file, but I would love to have a d3d crosshair.

I added ac1d posted functions but as I said, it does not load a crosshair on my screen.

Don't flame me much :P
You need an endscene or present (google it)
Then you draw the crosshair in there

Quote Originally Posted by pr0h4x0r View Post
Fro universal FPS counter help me out with this error
:
1>.\Base.cpp(24) : error C3861: 'clock': identifier not found
Caption Obvious To The Rescue!
Dont post errors here. Have a google.
Search on MSDN
What is the delete font function?
Posts 16–30 of 189 · Page 2 of 13
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?