Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    luizimloko's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    1,799
    Reputation
    136
    Thanks
    9,834
    My Mood
    Yeehaw

    ESPHealth Bars/String

    Hello guys, todday i posting a Simple Function ESPHealth with two options Bars/String, Hope you enjoy

    Code:
    struct cVertex 
    { 
     	float x, y, z, h;
    	D3DCOLOR color;
    	float tu, tv;
    	static DWORD FVF; 
    };
    
    VOID cD3D::DrawFilledRectangle(FLOAT x, FLOAT y, FLOAT w, FLOAT h, DWORD dwColor, LPDIRECT3DDEVICE9 pDevice)
    {
    	if(!pDevice)
    		return;
    
    	cVertex vertices[4] =
    	{
    		x, y, 0.0f, 1.0f, dwColor, 0.0f, 0.0f,
    		x + w, y, 0.0f, 1.0f, dwColor, 1.0f, 0.0f,
    
    		x + w, y + h, 0.0f, 1.0f, dwColor, 1.0f, 1.0f,
    		x, y + h, 0.0f, 1.0f, dwColor, 0.0f, 1.0f,
    	};
    	pDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertices, sizeof(cVertex));
    }
    
    VOID cD3D::DrawHealthBars(INT Bars, INT String, INT x, INT y, WORD health, BOOL bCheckSpawnS, BOOL iSpawnCheck, LPDIRECT3DDEVICE9 pDevice)
    {
    	// Original Bars Function By: Gellin, Modified for Bars/String Options By: luizimloko
    
    	DWORD dwColor;
    	CHAR szHealth[256];
    
    	if(health > 100) 
    		health = 100; 
    
    	if(health > 75) 
    		dwColor = 0xFF00FF00; 
    	else if(health > 40) 
    		dwColor = 0xFFFF9B00;
    	else 
    		dwColor = 0xFFFF0000; 
    
    	if(bCheckSpawnS)
    		if(iSpawnCheck)
    			dwColor = 0xFF000000;
    
    	DWORD dwDrawWidth = health / 4;
    
    	if(dwDrawWidth <= 2)
    		dwDrawWidth = 4;
    
    	if(Bars) { // Gellin
    		DrawFilledRectangle(x - 1, y - 1, 27, 5, 0xFF000000, pDevice);
    		DrawFilledRectangle(x, y, dwDrawWidth, 3, dwColor, pDevice);
    	}
    	if(String) { // luizimloko
    		sprintf(szHealth,  "Health: %d %%", health);
    		D3D->PrintText(D3D->pFont, x, y, TCenter, dwColor, szHealth);
    	}
    }
    How to use:

    Code:
    Bars:
    
    D3D->DrawHealthBars(TRUE, FALSE, ScreenPosition.x - 10, ScreenPosition.y - 35, Health->nHealth, TRUE, Health->bSpawnSheild, pDevice);
    
    String:
    
    D3D->DrawHealthBars(FALSE, TRUE, ScreenPosition.x, ScreenPosition.y - 35, Health->nHealth, TRUE, Health->bSpawnSheild, pDevice);
    Crédits:
    @gellin, donoob




    Last edited by luizimloko; 09-07-2012 at 08:49 PM.
    Contributor Since: 02-18-2012

    WarFace Brazil:


    Crossfire Brazil ( X-Trap ):


    WarRock Brazil ( HackShield ):



  2. The Following 5 Users Say Thank You to luizimloko For This Useful Post:

    BluntGod_ (09-07-2012),Nightmare (09-10-2012),pDevice (10-15-2012),ronaldowynnek (09-26-2012),Shadow` (09-16-2012)

  3. #2
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    that's a sick menu bro. should share XD

    commando: You're probably the best non-coder coder I know LOL


  4. #3
    Shadow`'s Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    MN
    Posts
    643
    Reputation
    74
    Thanks
    2,999
    My Mood
    Relaxed
    Quote Originally Posted by supercarz1991 View Post
    that's a sick menu bro. should share XD
    Well, the concept of his menu is actually quite simple. He basically draws a sprite, and has a static number of page numbers or something as an integer. When the arrows are clicked, the number is changed (however he changes it is up to him). Well, that's how I assume he did it. It's still sick though :3

  5. #4
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    Quote Originally Posted by Shadow` View Post
    Well, the concept of his menu is actually quite simple. He basically draws a sprite, and has a static number of page numbers or something as an integer. When the arrows are clicked, the number is changed (however he changes it is up to him). Well, that's how I assume he did it. It's still sick though :3
    every time i've tried to do a sprite, it wont compile...

    commando: You're probably the best non-coder coder I know LOL


  6. #5
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,696
    Reputation
    3319
    Thanks
    11,111
    My Mood
    Happy
    Quote Originally Posted by supercarz1991 View Post
    every time i've tried to do a sprite, it wont compile...
    Whits Base v2->Download->Change Sprite
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  7. #6
    luizimloko's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    fs:[0]
    Posts
    1,799
    Reputation
    136
    Thanks
    9,834
    My Mood
    Yeehaw
    Quote Originally Posted by comando2056 View Post


    Whits Base v2->Download->Change Sprite
    this base is not Withs Base v2
    Contributor Since: 02-18-2012

    WarFace Brazil:


    Crossfire Brazil ( X-Trap ):


    WarRock Brazil ( HackShield ):



  8. #7
    Shadow`'s Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    MN
    Posts
    643
    Reputation
    74
    Thanks
    2,999
    My Mood
    Relaxed
    Quote Originally Posted by luizimloko View Post


    this base is not Withs Base v2
    He was just explaining how to correctly do a sprite by telling him to look in whit's base v2

  9. The Following 2 Users Say Thank You to Shadow` For This Useful Post:

    [MPGH]Flengo (09-08-2012),luizimloko (09-09-2012)

  10. #8
    Avery17's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    28
    Reputation
    21
    Thanks
    10
    Menu system looks very simple, though the sprite is kinda cool looking its just a sprite and nothing special.

    Good post, I made a system with very similar code on my own for WarRock.

  11. #9
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    37
    Reputation
    10
    Thanks
    51
    My Mood
    Fine
    Just do it like this:

    Code:
    LPDIRECT3DTEXTURE9 Banner;
    LPD3DXSPRITE Sprite;
    
    void CreateSprite(LPDIRECT3DDEVICE9 pDevice)
    {
    	{
    		D3DXCreateTextureFromFileInMemoryEx(pDevice, &myFile, sizeof(myFile), 600 ,500, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &Banner);
    	    D3DXCreateSprite(pDevice,&Sprite);
       }
    }
    
    void DrawSprite(LPDIRECT3DDEVICE9 pDevice){
    	D3DXVECTOR3 POS;
    	POS.x = MenX;
    	POS.y = MenY;
    	POS.z = 0;
    	if(Banner==NULL){CreateSprite(pDevice);}
    	Sprite->Begin(D3DXSPRITE_ALPHABLEND); 
    	Sprite->Draw(Banner,NULL,NULL,&POS,0xFFFFFFFF);
    	Sprite->End();
    }
    Then call it in Present:
    Code:
    DrawSprite(pDevice);
    PS: myFile is your image byte array
    Haters Gon' Hate

  12. #10
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    i was thinkin about doin sprites for health boxes

    you know

    Green while above 50HP
    change to Yellow 49 and under
    red under 15

    pokemon style

    commando: You're probably the best non-coder coder I know LOL


  13. The Following User Says Thank You to supercarz1991 For This Useful Post:

    Synthesised (10-28-2012)

  14. #11
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    37
    Reputation
    10
    Thanks
    51
    My Mood
    Fine
    easy too supercarz
    Haters Gon' Hate

  15. #12
    wraithkilla's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    257
    Reputation
    10
    Thanks
    895
    My Mood
    Busy
    Quote Originally Posted by RedAppleCoder View Post
    easy too supercarz
    why so active ?

  16. #13
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    37
    Reputation
    10
    Thanks
    51
    My Mood
    Fine
    Quote Originally Posted by wraithkilla View Post
    why so active ?
    why not
    Haters Gon' Hate

  17. #14
    wraithkilla's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    257
    Reputation
    10
    Thanks
    895
    My Mood
    Busy
    Quote Originally Posted by RedAppleCoder View Post
    why not
    becaus you think this is time waste ?

  18. #15
    Nightmare's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    North of Hell
    Posts
    2,399
    Reputation
    149
    Thanks
    6,560
    My Mood
    Worried
    Pretty cool guy

Page 1 of 3 123 LastLast

Similar Threads

  1. How to Change the Start-Bar in Windows XP
    By Jackal in forum General
    Replies: 31
    Last Post: 05-31-2015, 09:29 PM
  2. [Release] ESPHealth Bars/String
    By luizimloko in forum Combat Arms BR Hack Coding/Source Code
    Replies: 21
    Last Post: 09-10-2012, 06:16 PM
  3. User bars
    By mostwanted in forum Spammers Corner
    Replies: 4
    Last Post: 08-21-2009, 06:28 PM
  4. User bar
    By jadedfrog in forum Help & Requests
    Replies: 1
    Last Post: 02-21-2006, 11:16 AM
  5. MPGH's User Bar
    By mostwanted in forum General
    Replies: 17
    Last Post: 02-20-2006, 01:34 AM