Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0

    Question About D3D Drawing Text

    Ok so here is acid's post:
    Quote Originally Posted by ac1d_buRn View Post

    Before we start, Make sure you have this in your globals:
    [php]
    LPD3DXFONT pFont;
    LPDIRECT3DDEVICE9 pDevice;
    [/php]

    Draw Text:

    After Globals:
    [php]
    void PrintText(LPD3DXFONT Font, long x, long y, D3DCOLOR fontColor, char *text, ...)//Draw Text Function
    {
    RECT rct;
    rct.left = x - 1;
    rct.right = x + 1;
    rct.top = y - 1 ;
    rct.bottom = y + 1;

    if(!text) { return; }
    va_list va_alist;
    char logbuf[256] = {0};
    va_start (va_alist, text);
    _vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
    va_end (va_alist);
    RECT FontRect = { x, y, x, y };
    pFont->DrawText(NULL, logbuf, -1, &rct, DT_NOCLIP, fontColor);
    }
    [/php]

    And to use the function (In Endscene):
    [php]
    PrintText(pFont, X, Y, D3DCOLOR_XRGB(0,0,0), "Your Text Here");
    [/php]

    I am pretty new to coding but am really good at VB so I get the handle of it, I've been coding for about 3 weeks now, but when I insert the globals I get an error "IntelliSense: identifier "LPD3DXFONT" is undefined r:\users\r\d\vs\p\6\6\base.cpp".. I am thinking it has to do with some sort of package I have not installed, EG: a D3D package adding LPD3DXFONT. Any help is appreciated, thank you.

    EDIT:: A look at my code:
    [php]#include <windows.h>
    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll" ) != NULL
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL
    && GetModuleHandleA( "CShell.dll" ) != NULL )
    return true;
    return false;
    }
    void PTC(const char* Command) {
    DWORD CNADDIE = 0x007d9200;
    void* Send = ( void* )*( DWORD* )(CNADDIE);
    __asm
    {
    /* CREDITS TO CN */
    push Command;
    call Send;
    add esp, -3-1+2+6;
    }
    }
    void main()
    {
    while(true)
    {
    //Hacks here (removed for length) but they all work.
    }}
    DWORD WINAPI dwHackThread(LPVOID)
    {
    while( !IsGameReadyForHook() )
    Sleep(100);
    main();
    return 0;
    }
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if ( dwReason == DLL_PROCESS_ATTACH )
    {
    CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
    }
    return TRUE;
    }
    [/php]

    EDIT:: Also I wanted to thank acid and codernever for everything they are doing in these forums it has been so amazing what they have tought me.
    Last edited by BlackHaexGuns; 07-21-2010 at 04:23 PM.

  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    give us the line of code its on but you didnt define it so your kinda no0b..

  3. #3
    coryster2100's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    394
    Reputation
    13
    Thanks
    1,175
    Code:
    void cBase::RenderFrame(LPDIRECT3DDEVICE9 pDevice)
    {
    	//RenderFrame
    	if( Directx.pFont == NULL ){
    		D3DXCreateFontA(pDevice, 14, 0, FW_BOLD, 1, FALSE,DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &Directx.pFont);
    	}else{
    		Menu.RenderMenu();
    	}
    
    	if( Directx.pFont == NULL )
    		Directx.pFont->OnLostDevice();
    	else
    	{
    		Directx.DrawString(0, 0, D3DCOLOR_ARGB(255, 255, 0, 0), Directx.pFont, "TEXT");
    Menu.RenderMenu();
    	}
    This might work idk i am not going to give you mine rite off the back just to keep choobs from C+Ping.

    NOTE. this is for a menu base

  4. #4
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    Actually I did try to define it but it didn't work.

    Code with definitions in there:
    [php]
    #include <windows.h>
    LPD3DXFONT pFont;
    LPDIRECT3DDEVICE9 pDevice;
    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll" ) != NULL
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL
    && GetModuleHandleA( "CShell.dll" ) != NULL )
    return true;
    return false;
    }
    void PTC(const char* Command) {
    DWORD CNADDIE = 0x007d9200;
    void* Send = ( void* )*( DWORD* )(CNADDIE);
    __asm
    {
    /* CREDITS TO CN */
    push Command;
    call Send;
    add esp, -3-1+2+6;
    }
    }
    void main()
    {
    while(true)
    {
    //Hacks here (removed for length) but they all work.
    }}
    DWORD WINAPI dwHackThread(LPVOID)
    {
    while( !IsGameReadyForHook() )
    Sleep(100);
    main();
    return 0;
    }
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if ( dwReason == DLL_PROCESS_ATTACH )
    {
    CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
    }
    return TRUE;
    }
    [/php]

    coryster:

    Errors with your code (not that you have errors but I do):
    [php] 1 IntelliSense: name followed by '::' must be a class or namespace name c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 2
    2 IntelliSense: identifier "LPDIRECT3DDEVICE9" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 2
    3 IntelliSense: identifier "Directx" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 5
    4 IntelliSense: identifier "D3DXCreateFontA" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 6
    5 IntelliSense: identifier "Menu" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 8
    6 IntelliSense: identifier "D3DCOLOR_ARGB" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 15
    7 IntelliSense: identifier "Menu" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 16
    8 IntelliSense: expected a ';' c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 20
    9 IntelliSense: identifier "PTC" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 61
    [/php]

  5. #5
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Include Directx sdk in your project

  6. #6
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    I know this will probably make you mad but I don't have it. That's why in the first post I was saying I think it has something to do with that since it is not identifying "LPDIRECT3DDEVICE9" or anything.

  7. #7
    CoderNever's Avatar
    Join Date
    Feb 2009
    Gender
    female
    Location
    https://mpgh.net MPGHCash: $700,458,011
    Posts
    1,198
    Reputation
    131
    Thanks
    2,236
    My Mood
    Buzzed
    Lol you don't have a directx hook?

  8. #8
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    No. I'm not new to programming but I am new to D3D, DirectX, and Combat Arms Hacks..

  9. #9
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    https://mpgh.net MPGHCash: $442,596,199
    Posts
    5,645
    Reputation
    26
    Thanks
    896
    My Mood
    Happy
    oh...my...god. do you even have the menu class that gellin provided in your source? of course you are going to have compiling errors

  10. #10
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    No I don't, I told you I'm new to making hacks, well, directx/d3d hacks.

  11. #11
    coryster2100's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    394
    Reputation
    13
    Thanks
    1,175
    Quote Originally Posted by BlackHaexGuns View Post
    Actually I did try to define it but it didn't work.

    Code with definitions in there:
    [php]
    #include <windows.h>
    LPD3DXFONT pFont;
    LPDIRECT3DDEVICE9 pDevice;
    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll" ) != NULL
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL
    && GetModuleHandleA( "CShell.dll" ) != NULL )
    return true;
    return false;
    }
    void PTC(const char* Command) {
    DWORD CNADDIE = 0x007d9200;
    void* Send = ( void* )*( DWORD* )(CNADDIE);
    __asm
    {
    /* CREDITS TO CN */
    push Command;
    call Send;
    add esp, -3-1+2+6;
    }
    }
    void main()
    {
    while(true)
    {
    //Hacks here (removed for length) but they all work.
    }}
    DWORD WINAPI dwHackThread(LPVOID)
    {
    while( !IsGameReadyForHook() )
    Sleep(100);
    main();
    return 0;
    }
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if ( dwReason == DLL_PROCESS_ATTACH )
    {
    CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
    }
    return TRUE;
    }
    [/php]

    coryster:

    Errors with your code (not that you have errors but I do):
    [php] 1 IntelliSense: name followed by '::' must be a class or namespace name c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 2
    2 IntelliSense: identifier "LPDIRECT3DDEVICE9" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 2
    3 IntelliSense: identifier "Directx" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 5
    4 IntelliSense: identifier "D3DXCreateFontA" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 6
    5 IntelliSense: identifier "Menu" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 8
    6 IntelliSense: identifier "D3DCOLOR_ARGB" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 15
    7 IntelliSense: identifier "Menu" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 16
    8 IntelliSense: expected a ';' c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 20
    9 IntelliSense: identifier "PTC" is undefined c:\users\main\documents\visual studio 2010\projects\6\6\base.cpp 61
    [/php]
    Lol bro download DirectX SDK February and the include d3dx9.h into your project

  12. #12
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by coryster2100 View Post
    Lol bro download DirectX SDK February and the include d3dx9.h into your project
    Will do downloading now, thank you for actually helping me instead of just laughing at me.

  13. #13
    coryster2100's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    394
    Reputation
    13
    Thanks
    1,175
    o think i did laugh at you hence the LOL

  14. #14
    BlackHaexGuns's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    instead of just laughing at me.
    You didn't JUST laugh at me, you gave me an answer to so, idc if you laugh at me as long as I get help. Hehe

  15. #15
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,404
    Reputation
    157
    Thanks
    4,003
    My Mood
    Flirty
    .
    You dont even have a directx hook in there.

    Just go use gellins base liek every other noob has done.

    If you dont know how to fix gellins base, then you wont be able to even do this

Page 1 of 2 12 LastLast

Similar Threads

  1. [Solved] Just a small question about D3D
    By MightySaa0d in forum CrossFire Help
    Replies: 6
    Last Post: 10-08-2011, 08:57 AM
  2. Question about Text title change
    By | ∞ | in forum General
    Replies: 10
    Last Post: 06-10-2011, 01:38 PM
  3. [Help] Remove Draw text (D3D)
    By Lyoto Machida in forum C++/C Programming
    Replies: 4
    Last Post: 05-26-2011, 06:59 PM
  4. [Question] About Text Color...!~ [MPGH]
    By CheatCreatorzz in forum Suggestions, Requests & General Help
    Replies: 5
    Last Post: 03-21-2011, 12:16 PM
  5. question about zoom
    By yocinfluence in forum WarRock - International Hacks
    Replies: 4
    Last Post: 01-26-2006, 10:12 PM