Front/Back Chams

Posts 110 of 10 · Page 1 of 1
Front/Back Chams
A lot of people ask me how to do the front/back chams.
Its pretty easy


Here is the choice in coulors for the front and back.

Code:
//Back Chams option
if(opt.chams.bChams)
{
if (iStride == 40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);

}
if (iStride == 44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);

}
if (iStride == 32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);
if(opt.chams.bChams==1) pDevice->SetTexture(0, White);
if(opt.chams.bChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.bChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.bChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.bChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.bChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.bChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.bChams==8) pDevice->SetTexture(0, Orange);
pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);

}
}


//Front Chams option
if(opt.chams.fChams)
{
if (iStride == 40)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);

pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
if (iStride == 44)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);

pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
if (iStride == 32)
{
pDevice->SetRenderState(D3DRS_ZENABLE, 0);

pDrawIndexedPrimitive(pDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
pDevice->SetRenderState(D3DRS_ZENABLE, 1);
if(opt.chams.fChams==1) pDevice->SetTexture(0, White);
if(opt.chams.fChams==2) pDevice->SetTexture(0, Red);
if(opt.chams.fChams==3) pDevice->SetTexture(0, Green);
if(opt.chams.fChams==4) pDevice->SetTexture(0, Blue);
if(opt.chams.fChams==5) pDevice->SetTexture(0, Black);
if(opt.chams.fChams==6) pDevice->SetTexture(0, Purple);
if(opt.chams.fChams==7) pDevice->SetTexture(0, Yellow); 
if(opt.chams.fChams==8) pDevice->SetTexture(0, Orange);
}
}

Hihi now every one have the front/back option
thank you this wil help me
Thank You For Sharing
thank you.
BTW what is stride 32?
is it for guns?
and if it is why not adding an extra option asking for gun chams?
Quote Originally Posted by giniyat101 View Post
thank you.
BTW what is stride 32?
is it for guns?
and if it is why not adding an extra option asking for gun chams?
Yes its for guns hmm thats a good idea thanks i will use that
lol , ur code looks like untidy room
i Arranged it for u , looks allot better :

Code:
#define color pDevice->SetTexture(0
if(opt.chams.bChams)
{
	if (iStride == (40 || 44 || 32)
	{
		pDevice->SetRenderState(D3DRS_ZENABLE, 0);
		switch (opt.chams.bChams)
		{
			case 1 : color,White); break;
			case 2 : color,Red); break;
			case 3 : color,Green); break;
			case 4 : color,Blue); break;
			case 5 : color,Black); break;
			case 6 : color,Purple); break;
			case 7 : color,Yellow); break;
			case 8 : color,Orange); break;
		}
	}
}

any way , ur way cost 100% of memory , my way is allot better , donn't cost any byte of memory , so pc/cf never crash or lag
Quote Originally Posted by [N.O]N.A.M.E View Post
lol , ur code looks like untidy room
i Arranged it for u , looks allot better :

Code:
#define color(col) pDevice->SetTexture(0, col)
#define Strides ((iStride == 40) || (iStride == 44) || (iStride == 32))
if(opt.chams.bChams)
{
	if (Strides)
	{
		pDevice->SetRenderState(D3DRS_ZENABLE, 0);
		switch (opt.chams.bChams)
		{
			case 1 : color(White); break;
			case 2 : color(Red); break;
			case 3 : color(Green); break;
			case 4 : color(Blue); break;
			case 5 : color(Black); break;
			case 6 : color(Purple); break;
			case 7 : color(Yellow); break;
			case 8 : color(Orange); break;
		}
	}
}

any way , ur way cost 100% of memory , my way is allot better , donn't cost any byte of memory , so pc/cf never crash or lag
arranged again and fixed one mistake
Quote Originally Posted by [N.O]N.A.M.E View Post
lol , ur code looks like untidy room
i Arranged it for u , looks allot better :

Code:
#define color pDevice->SetTexture(0
if(opt.chams.bChams)
{
	if (iStride == (40 || 44 || 32)
	{
		pDevice->SetRenderState(D3DRS_ZENABLE, 0);
		switch (opt.chams.bChams)
		{
			case 1 : color,White); break;
			case 2 : color,Red); break;
			case 3 : color,Green); break;
			case 4 : color,Blue); break;
			case 5 : color,Black); break;
			case 6 : color,Purple); break;
			case 7 : color,Yellow); break;
			case 8 : color,Orange); break;
		}
	}
}

any way , ur way cost 100% of memory , my way is allot better , donn't cost any byte of memory , so pc/cf never crash or lag
Hehe I'm chaotic.
these are chams here

[highlight=CPP]
DWORD dwOldZEnable;
pDevice->SetTexture(1,0);// if they is a texture on top of it, disable
pDevice->SetTexture(0,bacTex);// Set the back color for like behind wall and stuff
pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable);// get the current ZEnable Data and store it
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);// Set the ZEnable to false
pDevice->SetRenderState(D3DRS_LIGHTING, true);// turn on the lights
pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);// Draw the back Texture
pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);// Put the ZEnable to what it was before
pDevice->SetTexture(0,froTex);// Set the Front Texture
pDevice->SetRenderState(D3DRS_LIGHTING, true);// Yes back with the lighting on
// Return which will draw the front texture.
[/highlight]
Quote Originally Posted by topblast View Post
these are chams here

[highlight=CPP]
DWORD dwOldZEnable;
pDevice->SetTexture(1,0);// if they is a texture on top of it, disable
pDevice->SetTexture(0,bacTex);// Set the back color for like behind wall and stuff
pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable);// get the current ZEnable Data and store it
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);// Set the ZEnable to false
pDevice->SetRenderState(D3DRS_LIGHTING, true);// turn on the lights
pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);// Draw the back Texture
pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);// Put the ZEnable to what it was before
pDevice->SetTexture(0,froTex);// Set the Front Texture
pDevice->SetRenderState(D3DRS_LIGHTING, true);// Yes back with the lighting on
// Return which will draw the front texture.
[/highlight]
he just made a lot of colors to choose from.
Posts 110 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?