D3D9 Chams Tutorial

Posts 46–60 of 66 · Page 4 of 5
sorry to be the stupidest nub in the world but can say what files you open?
fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory
is Combat arms player stride number 32?
this is old and has been patched...
Quote Originally Posted by JangoSolo View Post
this is old and has been patched...
Lol, $5 says you didnt understand the first post on this thread.
you need to make a textures.h header file...
should be sticked!!!! and thanx for tutorial xD
SOME PM A PRE MADE VERSION OF THIS
dam thanks
does it work for all games when i change the stride?
Quote Originally Posted by Synns View Post
This is a D3D9 chams tutorial.

Defines -

Code:
bool Chams;
UINT m_Stride;
LPDIRECT3DTEXTURE9    texGreen;
LPDIRECT3DTEXTURE9    texYellow;

Above Initialize() -

Code:
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
	if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
		return E_FAIL;
	
	WORD colour16 =	((WORD)((colour32>>28)&0xF)<<12)
			|(WORD)(((colour32>>20)&0xF)<<8)
			|(WORD)(((colour32>>12)&0xF)<<4)
			|(WORD)(((colour32>>4)&0xF)<<0);

	D3DLOCKED_RECT d3dlr;    
	(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
	WORD *pDst16 = (WORD*)d3dlr.pBits;

	for(int xy=0; xy < 8*8; xy++)
		*pDst16++ = colour16;

	(*ppD3Dtex)->UnlockRect(0);

	return S_OK;
}


Initialize() -

Code:
GenerateTexture(m_pD3Ddev, &texYellow,D3DCOLOR_ARGB(255,255,255,0));
GenerateTexture(m_pD3Ddev, &texGreen,D3DCOLOR_ARGB(255,0,255,0));
DrawIndexedPrimitive -

Code:
	if (Chams) 
	{
		if (m_Stride == 44)
		{
             DWORD dwOldZEnable = D3DZB_TRUE;
             m_pD3Ddev->SetTexture(0, texYellow);
             m_pD3Ddev->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable);
             m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
			 m_pD3Ddev->DrawIndexedPrimitive(Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
             m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
             m_pD3Ddev->SetTexture(0, texGreen);
}
	}
SetStreamSource -

Code:
if( StreamNumber == 0 ){m_Stride = Stride;}
BeginScene -

Code:
		if (GetAsyncKeyState(VK_INSERT)&1)
{
	Chams = !Chams;
}
What you need?

C++ , MS Visual Studio

A SDK , I use august 2007

The stride is the CA main player stride, the hotkey is insert if you successfully make chams and compile!

Post all errors and questions I WILL help ~~~~
where it says defines- and BeginScene - and so on what u do with em make them into seperate dll's?

i just started learning code today but i am a fast learner

it would be really cool if u made a vid on how to do it

is it possible to do this with dev-C++
how would I compile this, I'm am really eager to learn how to compile premade scripts like this xP I just don't know how, I only know basic c++ and haven't learned d3d yet. Please Help =)
Posts 46–60 of 66 · Page 4 of 5
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us