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,879
    Reputation
    136
    Thanks
    10,140
    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 07:49 PM.

  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
    Posts
    6,298
    Reputation
    494
    Thanks
    3,747
    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
    636
    Reputation
    74
    Thanks
    3,015
    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
    Posts
    6,298
    Reputation
    494
    Thanks
    3,747
    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
    /admincp/banning.php
    Posts
    20,710
    Reputation
    5180
    Thanks
    14,206
    My Mood
    Inspired
    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 | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.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,879
    Reputation
    136
    Thanks
    10,140
    My Mood
    Yeehaw
    Quote Originally Posted by comando2056 View Post


    Whits Base v2->Download->Change Sprite
    this base is not Withs Base v2

  8. #7
    Shadow`'s Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    MN
    Posts
    636
    Reputation
    74
    Thanks
    3,015
    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
    36
    Reputation
    10
    Thanks
    54
    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
    Posts
    6,298
    Reputation
    494
    Thanks
    3,747
    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
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    easy too supercarz
    Haters Gon' Hate

  15. #12
    wraithkilla's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    258
    Reputation
    10
    Thanks
    907
    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
    36
    Reputation
    10
    Thanks
    54
    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
    258
    Reputation
    10
    Thanks
    907
    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,396
    Reputation
    149
    Thanks
    6,602
    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, 08: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, 05:16 PM
  3. User bars
    By mostwanted in forum Spammers Corner
    Replies: 4
    Last Post: 08-21-2009, 05:28 PM
  4. User bar
    By jadedfrog in forum Help & Requests
    Replies: 1
    Last Post: 02-21-2006, 10:16 AM
  5. MPGH's User Bar
    By mostwanted in forum General
    Replies: 17
    Last Post: 02-20-2006, 12:34 AM