there are a lot of things wrong in your source.
Partially, i dont see how pDevice is called in PaintMenu >_>
So what is going wrong? The hook is working fine since it runs forever without pressing the menu key. Here's the menu paint code and my present.
Present:Code:void PaintMenu() { if(Font){ Font->Release(); Font = NULL; f = false; } if(!f){ D3DXCreateFont(pDevice, 14, 6, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Font); f= true; } if(GetAsyncKeyState(MK)&1){iMenu =! iMenu; } if(iMenu && Font){ pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); } char Timestruct[16] = "hh':'mm':'ss tt"; char TimeString[25]; GetTimeFormatA(NULL,NULL,NULL,NULL,Timestruct,15); sprintf(TimeString,"%s",Timestruct); if(iMenu && ((GetAsyncKeyState(VK_UP)&1))){ ...Go up menu... } if(iMenu && ((GetAsyncKeyState(VK_DOWN)&1))){ ...Go Down menu.. if(iMenu && ((GetAsyncKeyState(VK_RIGHT)&1))){ if(iMenu){ ...turns on hacks... ....just simple math... } } } if(iMenu && ((GetAsyncKeyState(VK_LEFT)&1))){ if(iMenu){ .... Turns off hacks just simple math ... } } } if(iMenu && Font){ ...Actually painting Menu here...Just a simple DrawBox and DrawText function } } }
Reset:Code:HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND stWindowOverride, CONST RGNDATA *pDirtyRegion) { _asm pushad; PaintMenu(); ActivateHacks(); _asm popad; return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion); }
Code:HRESULT WINAPI gellReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* Parametri) { Font->OnLostDevice(); HRESULT kReset = pReset(pDevice, Parametri); if(SUCCEEDED(kReset)){Font->OnResetDevice();} return kReset; }
Note: It builds fine in release mode so ignore any {/}, definition, and major syntax errors
I do not know whats wrong, am I using the right render state? Am I supposed to be hooking present? Am I doing the Reset correctly?
I appreciate any advice.
there are a lot of things wrong in your source.
Partially, i dont see how pDevice is called in PaintMenu >_>
No I do not make game hacks anymore, please stop asking.
Can you tell me what you see is wrong? And im calling it like(if thats what you mean):
If you want me to paste in those functions I will but they are just the standard ones found in that D3D thread that is stickied.Code:DrawText(300,300,Green,"No Recoil On",pDevice); //and DrawBox(320,320,520,520, Green, Black, pDevice);
Last edited by fakeness; 02-02-2012 at 03:54 PM.
Code:void DrawText(int x,int y,DWORD color,char *text, LPDIRECT3DDEVICE9 pDevice){ RECT rect; SetRect( &rect, x, y, x, y ); Font->DrawTextA(NULL,text,-1,&rect, DT_LEFT|DT_NOCLIP, color); }Code:void DrawRect(int x,int y,int h,int w,DWORD Color,LPDIRECT3DDEVICE9 pDevice){ D3DRECT rec; rec.x1 = x; rec.x2 = x + w; rec.y1 = y; rec.y2 = y + h; pDevice->Clear(1,&rec,D3DCLEAR_TARGET,Color,0,0); } void DrawBox(int x,int y,int h,int w,D3DCOLOR Border, D3DCOLOR Fill,LPDIRECT3DDEVICE9 pDevice){ DrawRect(x,y,h,w,Fill,pDevice); DrawRect(x,y,h,1,Border,pDevice); DrawRect(x+w,y,h,1,Border,pDevice); DrawRect(x,y,1,w, Border,pDevice); DrawRect(x,y+h,1,w+1, Border,pDevice); DrawRect(x+2,y+2,h-4,2,Border,pDevice); DrawRect(x+2,y+2,2,w-4, Border,pDevice); DrawRect(x+w-4,y+2,h-4,2,Border,pDevice); DrawRect(x+2,y+h-4,2,w-4, Border,pDevice); }
What fail ...... Check your PaintMenu and the functions in there. And also make sure your detours and hook are updated. Hope i helped have a great day.
Man. You need to give the PaintMenu function the parameter pDevice.
As example void PaintMenu(ID3D11Device* pDevice).
Im using Directx11 pDevice so you need to search whats pDevice declared in DX9.
Have a nice day and thank me if I helped you plz.
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
First, you want to narrow down what the problem could be. Comment out pointless stuff or just don't use fonts and see what happens.
Second, try making a better draw function. I'm not sure if the ones I custom made still work since there over 6 months old, but be original, change it up.
When something like this happened to me I just commented out everything and just drew one box, and if it d/c then I knew something was wrong with that specific function. Then if everything works, then I'll print text, etc. Continue to progress and test.
Also try a different hook. I don't think Gellin's works
Last edited by -Dimensions-; 02-09-2012 at 05:23 PM.
The thinig wrong is.
the pDevice is fucked
No I do not make game hacks anymore, please stop asking.