OldSchoolHack

Register / Login English

Chams Problem

icon Thread: Chams Problem

Join Date: Dec 2011

Posts: 97

User-Rating:

2 positive
0 negative
Meine Code: 
TEXT Code:
  1. IDirect3DPixelShader9 *Yellow = NULL;
  2.  

TEXT Code:
  1. HRESULT GenerateShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf) {
  2.    char szShader[ 256 ];
  3.    ID3DXBuffer *pShaderBuf = NULL;
  4.    if (setzBuf){
  5.        sprintf_s( szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0\nmov oDepth, c0.x", r, g, b, 1.0f );
  6. }
  7.    else{
  8.        sprintf_s( szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0", r, g, b, 1.0f );
  9. }
  10.    D3DXAssembleShader(szShader, (strlen(szShader)+1), NULL, NULL, 0, &pShaderBuf, NULL );
  11.    if(FAILED(pD3Ddev->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)) )return E_FAIL;
  12.    return S_OK;
  13. }

TEXT Code:
  1. GenerateShader(pDevice, &Yellow, 1.0, 1.0f, 0.0f, false);

TEXT Code:
  1. HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount){
  2. if(menu.ChamState == true){
  3. if(Terrorist){
  4. pDevice->SetRenderState(D3DRS_ZENABLE, false);
  5. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  6. pDevice->SetPixelShader(Yellow);
  7. pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  8. pDevice->SetRenderState(D3DRS_ZENABLE, true);
  9. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  10. pDevice->SetPixelShader(Red);
  11. }
  12.  
  13. if(CounterTerrorist){
  14. pDevice->SetRenderState(D3DRS_ZENABLE, false);
  15. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  16. pDevice->SetPixelShader(Green);
  17. pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  18. pDevice->SetRenderState(D3DRS_ZENABLE, true);
  19. pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
  20. pDevice->SetPixelShader(Blue);
  21. }
  22. }
  23. return pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
  24. }

Jetzt sollte es Funktionieren (also mein dreck)

...
schick mal bitte n Screen Shot von deinen "BUGS"