Results 1 to 10 of 10
  1. #1
    Inferno17's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2

    Health check with structs

    I am trying to do a health check. If I write memory when I am not alive, when I respawn I crash. I need to do check where if my player has greater than 0 health, then write memory else restore original bytes.

    The problem is, I don't have structs to do health check.. Does anyone else do this? Can someone please give me structs for combat arms north america to do this?
    Last edited by Inferno17; 08-21-2012 at 04:12 AM.

  2. #2
    luccss's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    484
    Reputation
    183
    Thanks
    3,430
    My Mood
    Breezy
    Code:
    void DesenharSange (LPDIRECT3DDEVICE9 pDevice)
    {
    	        pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    
    	        cGameClientShell *pGameClientShell = *(cGameClientShell **) ADDR_GCS;
    	        cSFXMgr *SFXMgr = pGameClientShell->GetSFXMgr();
    
    	        g_LTClient = *(CLTClient**) LTClientDLL;
    
    		   GetPlayerByIndex = (lpGetPlayerByIndex)ADDR_PlayerByIndex;
    		    unsigned long ulThis = *(unsigned long *)ADDR_ClientInfoMgr;
    		    GetLocalPlayer = (lpGetLocalPlayer)ADDR_LocalPlayer;
    
    			for(INT i = 0; i < 32; i++) 
    		     {  
                  PlayerInfo *pPlayer = GetPlayerByIndex(ulThis, i, 0);
    			  D3DXVECTOR3 Position;
    			  if(pPlayer != 0 && pPlayer->obj != 0 && pPlayer->IsDead == 0) 
    			  {
                  if(WorldToScreen(pDevice, pPlayer, &Position)) 
    			  { 
                    if(ValidPointer(SFXMgr))
    						{ 
                            cCharacterFX* NPC = (cCharacterFX*)SFXMgr->SFXList[0x18].List[i];
    						if((*(BYTE *)GameStatus == 1) && (Sangue== 1 && ValidPointer(NPC))) 
    						{ 
                               int MaxHealthArmor = max(NPC->wHealth, NPC->wArmor);
    			               int BarWidth = (max(MaxHealthArmor, 100) / 5) + 1;
    			               D3DRECT rcHealth = {LONG(Position.x) - BarWidth, LONG(Position.y), LONG(Position.x) + BarWidth, LONG(Position.y) + 10};
    			               pDevice->Clear(1,  &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Black, 1.0f, 0);
    			               rcHealth.x1 += 1; rcHealth.y1 += 1; rcHealth.y2 -= 4;
    			               rcHealth.x2 = rcHealth.x1 + (2 * NPC->wHealth / 5);
    						   pDevice->Clear(1, &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, (NPC->wHealth <= 20 ? D3DCOLOR_ARGB(255, 255, 0, 0) : (NPC->wHealth <= 50 ? D3DCOLOR_ARGB(255, 255, 255, 0) : D3DCOLOR_ARGB(255, 0, 255, 0))), 1.0f, 0);
    			               rcHealth.y1 = rcHealth.y2;
    			               rcHealth.y2 += 3;
    			               rcHealth.x2 = rcHealth.x1 + (2 * NPC->wArmor / 5);
    			               pDevice->Clear(1,  &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Blue, 1.0f, 0); 
                             }
    
    					}
    			     }
                  
    			  } 
    		}
    }

  3. The Following 2 Users Say Thank You to luccss For This Useful Post:

    Ken Sugisaki (08-21-2012),Password77 (08-21-2012)

  4. #3
    Inferno17's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by luccss View Post
    Code:
    void DesenharSange (LPDIRECT3DDEVICE9 pDevice)
    {
    	        pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
    
    	        cGameClientShell *pGameClientShell = *(cGameClientShell **) ADDR_GCS;
    	        cSFXMgr *SFXMgr = pGameClientShell->GetSFXMgr();
    
    	        g_LTClient = *(CLTClient**) LTClientDLL;
    
    		   GetPlayerByIndex = (lpGetPlayerByIndex)ADDR_PlayerByIndex;
    		    unsigned long ulThis = *(unsigned long *)ADDR_ClientInfoMgr;
    		    GetLocalPlayer = (lpGetLocalPlayer)ADDR_LocalPlayer;
    
    			for(INT i = 0; i < 32; i++) 
    		     {  
                  PlayerInfo *pPlayer = GetPlayerByIndex(ulThis, i, 0);
    			  D3DXVECTOR3 Position;
    			  if(pPlayer != 0 && pPlayer->obj != 0 && pPlayer->IsDead == 0) 
    			  {
                  if(WorldToScreen(pDevice, pPlayer, &Position)) 
    			  { 
                    if(ValidPointer(SFXMgr))
    						{ 
                            cCharacterFX* NPC = (cCharacterFX*)SFXMgr->SFXList[0x18].List[i];
    						if((*(BYTE *)GameStatus == 1) && (Sangue== 1 && ValidPointer(NPC))) 
    						{ 
                               int MaxHealthArmor = max(NPC->wHealth, NPC->wArmor);
    			               int BarWidth = (max(MaxHealthArmor, 100) / 5) + 1;
    			               D3DRECT rcHealth = {LONG(Position.x) - BarWidth, LONG(Position.y), LONG(Position.x) + BarWidth, LONG(Position.y) + 10};
    			               pDevice->Clear(1,  &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Black, 1.0f, 0);
    			               rcHealth.x1 += 1; rcHealth.y1 += 1; rcHealth.y2 -= 4;
    			               rcHealth.x2 = rcHealth.x1 + (2 * NPC->wHealth / 5);
    						   pDevice->Clear(1, &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, (NPC->wHealth <= 20 ? D3DCOLOR_ARGB(255, 255, 0, 0) : (NPC->wHealth <= 50 ? D3DCOLOR_ARGB(255, 255, 255, 0) : D3DCOLOR_ARGB(255, 0, 255, 0))), 1.0f, 0);
    			               rcHealth.y1 = rcHealth.y2;
    			               rcHealth.y2 += 3;
    			               rcHealth.x2 = rcHealth.x1 + (2 * NPC->wArmor / 5);
    			               pDevice->Clear(1,  &rcHealth, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Blue, 1.0f, 0); 
                             }
    
    					}
    			     }
                  
    			  } 
    		}
    }
    That doesn't help me at all. No where in there is a check for health being greater than 0. And you didn't post structs with it so it's just useless code that you ripped out of a base.

  5. #4
    luccss's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    484
    Reputation
    183
    Thanks
    3,430
    My Mood
    Breezy
    where you`re read that code is mine ? code is all mmbob

  6. #5
    Password77's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Canada, ON
    Posts
    181
    Reputation
    10
    Thanks
    181
    My Mood
    Cheerful
    Quote Originally Posted by Inferno17 View Post
    That doesn't help me at all. No where in there is a check for health being greater than 0. And you didn't post structs with it so it's just useless code that you ripped out of a base.
    Structs? You mean you need cCharacterFX class? Oh do your own research and you will find it. @luccss never claimed it his anyway. Shut the hell up and appreciate the code.
    Doing more Java and Python
    Need help with your hack? Ask me, I will try to help you with all my might .

  7. The Following 2 Users Say Thank You to Password77 For This Useful Post:

    luccss (08-21-2012),Shadow` (08-21-2012)

  8. #6
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,991
    My Mood
    Flirty
    you dont even need characterfx. there is a death check in the PlayerInfo class. Just search a bit on the forums here and you will find it

  9. The Following 4 Users Say Thank You to ac1d_buRn For This Useful Post:

    Drake (08-25-2012),luccss (08-21-2012),matypatty (08-25-2012),NotRealPro (08-21-2012)

  10. #7
    Password77's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Canada, ON
    Posts
    181
    Reputation
    10
    Thanks
    181
    My Mood
    Cheerful
    Wait isn't the isDead function for local player but not your player? Or am i wrong O.o
    Quote Originally Posted by ac1d_buRn View Post
    you dont even need characterfx. there is a death check in the PlayerInfo class. Just search a bit on the forums here and you will find it
    Doing more Java and Python
    Need help with your hack? Ask me, I will try to help you with all my might .

  11. #8
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    1. Its no function, its a simple bool
    2. Its 100% the same struct as local player so I would suggest it works for both lol..

    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
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  12. #9
    Saltine's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    494
    Reputation
    104
    Thanks
    625
    Quote Originally Posted by Password77 View Post
    Wait isn't the isDead function for local player but not your player? Or am i wrong O.o
    Bro are you serious... local player = your player (as indicated by LOCAL)

    Oh no! Vortex is gay!

  13. The Following 2 Users Say Thank You to Saltine For This Useful Post:

    ac1d_buRn (08-25-2012),matypatty (08-25-2012)

  14. #10
    Password77's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Canada, ON
    Posts
    181
    Reputation
    10
    Thanks
    181
    My Mood
    Cheerful
    Quote Originally Posted by Saltine View Post

    Bro are you serious... local player = your player (as indicated by LOCAL)
    It was in playerinfo sorry i said local player O.o
    Doing more Java and Python
    Need help with your hack? Ask me, I will try to help you with all my might .

Similar Threads

  1. Replies: 6
    Last Post: 10-27-2011, 03:19 AM
  2. [Tutorial] Skipping "Check" New Post With Images
    By AFG4Lifee in forum Piercing Blow Tools
    Replies: 20
    Last Post: 03-08-2011, 07:05 PM
  3. help with combatarms pub? please check
    By randomedkid in forum General Game Hacking
    Replies: 2
    Last Post: 04-12-2009, 02:47 PM
  4. _Versus_hack with bronz prem(Check this MODS!)
    By _Versus_ in forum WarRock - International Hacks
    Replies: 31
    Last Post: 06-22-2008, 09:57 AM
  5. Adventure Quest Health Tutorial (with Pics)
    By Piebringer in forum BattleOn Games Hacks, Cheats & Trainers
    Replies: 11
    Last Post: 11-04-2007, 12:55 PM