Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > First-Person Shooters > Battlefield Series > Battlefield 2

- Sponsored Advertisement -
http://www.myfpscheats.com/

Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Battlefield 2
hacks cheats tutorials source code
You are Unregistered, please register to gain Full access.    
Reply
 
Thread Tools

Simple ESP Code
Old 04-26-2010, 11:03 AM   #1
The 0n3

Sfab1's Avatar

Join Date: Nov 2007
Location: Finland
Posts: 418
Reputation: 22105
Rep Power: 281
Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 16,124, Level: 16
Points: 16,124, Level: 16 Points: 16,124, Level: 16 Points: 16,124, Level: 16
Activity: 27.1%
Activity: 27.1% Activity: 27.1% Activity: 27.1%
Last Achievements
Simple ESP Code

Code:
void DrawESP( LPDIRECT3DDEVICE9 )
{
    char distance[512];
    char name[512];
    CPlayer* TargetPlayer = 0;
    D3DXVECTOR3 vHeadPos,vFootPos;
    D3DXVECTOR3 LocalViewMatrix[4];

    CCamera* player_view_camera;
    player_view_camera = player_manager->LocalPlayer->GetPlayerView();    
    GET_XAXIS_FROMMATRIX(&LocalViewMatrix[0], &player_view_camera->matrix );
    GET_YAXIS_FROMMATRIX(&LocalViewMatrix[1], &player_view_camera->matrix );
    GET_ZAXIS_FROMMATRIX(&LocalViewMatrix[2], &player_view_camera->matrix );
    GET_ORIGIN_FROMMATRIX(&LocalViewMatrix[3], &player_view_camera->matrix );

    for(int i = 0; i < 255; i++)
    {
        TargetPlayer = player_manager->GetPlayerByIndex(i);    

        if( cAim.IsValidTarget ( TargetPlayer ) && TargetPlayer != gLocalPlayer)
        {
            //if ( bScreenShot && ( ++iCurrentFrames < 200 ))
            //             continue;
            //        bScreenShot = 0;

            if ( strcmp ( TargetPlayer->szPlayerName.c_str(), gLocalPlayer->szPlayerName.c_str() ) == 0 )
                    continue;

            bool IsEnemy = TargetPlayer->nTeam != gLocalPlayer->nTeam;

            bool bGetHead = cAim.GetBonePos(&vHeadPos, 60, TargetPlayer);
            GET_ORIGIN_FROMMATRIX( &vFootPos, &TargetPlayer->playerinfo->ptr->Matrix );

            D3DXVECTOR3 Length = vHeadPos - LocalViewMatrix[3];
            float fDistance = D3DXVec3Length( &Length );

            float fHealth = ( float ) TargetPlayer->soldierinfo->ptr->ObjectArmor->Health;

            sprintf(name, "[%s]",TargetPlayer->szPlayerName.c_str());
            sprintf(distance, "[%.0f]",fDistance);

            UINT ps = (UINT)((fDistance*100)/850);
            if (ps > 100) ps = 100; ps=100-ps;
            UINT DoFade = (UINT)((ps*255)/100);

            if ( bGetHead && vFootPos )
            {
                if ( NewWorldToScreen( &vHeadPos ) && NewWorldToScreen ( &vFootPos ))
                {
                    bool IsVisible = cAim.IsVisible(vHeadPos,TargetPlayer, 60);

                    D3DCOLOR ESPCOL;
                    if(cVar.fVisESP)
                        ESPCOL = IsVisible ? D3DCOLOR_ARGB(DoFade,255,0,0) : D3DCOLOR_ARGB(DoFade,255,200,0);
                    else
                        ESPCOL = D3DCOLOR_ARGB(DoFade,255,0,0);

                    float RectYoffset = ((vFootPos.y+15) - vHeadPos.y);
                    float RectWidth = (RectYoffset/2);
                    float RectWidthPos = (vHeadPos.x - (RectWidth/2));

                    if(cVar.fNameESP)
                    {
                        if( IsEnemy ) 
                        {
                            cDX.DrawString( cDX.ESPFont, RectWidthPos, vHeadPos.y - ( RectYoffset / 6 ) - 10, ESPCOL, name);
                        }
                        else
                        {
                            cDX.DrawString( cDX.ESPFont, RectWidthPos, vHeadPos.y - ( RectYoffset / 6 ) - 10, D3DCOLOR_ARGB(DoFade,0,100,255), name);
                        }
                    }
                    if(cVar.fDistanceESP)
                    {
                        if( IsEnemy ) 
                        {
                            cDX.DrawString( cDX.ESPFont, RectWidthPos, vFootPos.y - ( RectYoffset / 6 ) + 15/*vFootPos.y + 15*/, ESPCOL, distance);
                        }
                        else
                        {

                        }
                    }
                }
            }
        }
    }
}
IsValidTarget is just ( TargetPlayer->bManAlive)&&(!TargetPlayer->bManDown ) && (TargetPlayer->soldierinfo ) && ( TargetPlayer->playerinfo->ptr ) && ( TargetPlayer->soldierinfo->ptr )

there is small calculation done for getting text centered based on taken bonepos, also there is ESP Fade effect (thanks tetsuo). You can also easily add boundingboxes wich are via bonepos just use ur imagination and see how name and distance esp are done.

whats this ?

if ( strcmp ( TargetPlayer->szPlayerName.c_str(), gLocalPlayer->szPlayerName.c_str() ) == 0 )
continue;

above code prevents esp drawn to localplayer...

credits: Me, Umezawa, Cardoow

+ uc-forum in general and ppl here who contributes their knowledge

enjoy
__________________

Sfab1 is online now

Reply With Quote


Old 04-26-2010, 11:11 AM   #2
SEGnosis
Guest

Posts: n/a
o: thanks for the contribution

Reply With Quote

Old 04-26-2010, 12:18 PM   #3
Level 3

fatboy88's Avatar

Join Date: May 2005
Posts: 1,103
Reputation: 38964
Rep Power: 494
fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!
Recognitions:
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 27,267, Level: 24
Points: 27,267, Level: 24 Points: 27,267, Level: 24 Points: 27,267, Level: 24
Activity: 9.9%
Activity: 9.9% Activity: 9.9% Activity: 9.9%
Last Achievements
I think it may be a better post with actually knowing what newworldtoscreen is


i could do the same


if(player[i]->Team != Local->Team){

WORLDTOSCREENBISHES(out,in,in);

}


where
\

this would be kinda better still not good but u get the drift

if(player[i]->Team != Local->Team){

:3DXVec3TransformCoord(&vec3,&origin,&WorldViewProj);


vec2.x = vp.width / 2 * vec3.x;
////etc

}
__________________


My greatest fear is a Windows Vista Update! D:

ȜǷ-ɲآɳᶨ4 Hack:http://img42.imageshack.us/img42/473/20090203132330.png

Last edited by fatboy88; 04-26-2010 at 12:37 PM.
fatboy88 is online now

Reply With Quote

Old 04-26-2010, 12:41 PM   #4
Hanoi's pimp

Jugga's Avatar

Join Date: May 2009
Location: United Kingdom
Posts: 357
Reputation: 8106
Rep Power: 122
Jugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATSJugga DEFINES UNKNOWNCHEATS
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (2)
Points: 7,394, Level: 9
Points: 7,394, Level: 9 Points: 7,394, Level: 9 Points: 7,394, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Code:
__declspec(naked) bool CEntity::NewWorldToScreen(D3DXVECTOR3* pVecInOut)
{
    _asm mov ecx, cTextWriter;
    _asm jmp [ g_dwWorldToScreen ];
}
__________________
Jugga is online now

Reply With Quote

Old 04-26-2010, 02:20 PM   #5
The 0n3

Sfab1's Avatar

Threadstarter
Join Date: Nov 2007
Location: Finland
Posts: 418
Reputation: 22105
Rep Power: 281
Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!Sfab1 has reputation that takes up 2GB of server space!
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 16,124, Level: 16
Points: 16,124, Level: 16 Points: 16,124, Level: 16 Points: 16,124, Level: 16
Activity: 27.1%
Activity: 27.1% Activity: 27.1% Activity: 27.1%
Last Achievements
oh yes

and in global updates

init it

HMODULE renddx9 = GetModuleHandle( "RendDx9.dll" );

g_dwWorldToScreenNew = FindPattern( (( DWORD ) renddx9 ) + 0x80000, 0x20000, ( PBYTE )"\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\x8B\xD\x00\x00\x00\x00\x8B\x1\x56\x57\xFF\x50\x00\x8B\xF0\x8B\x16\x8B\xCE\xFF\x52\x00\xD9\x40", "xxxxx????xx????xxxxxx?xxxxxxxx?xx" );

^
^
||

thanks patrick, forgot him from 1st credits, sorry
__________________

Sfab1 is online now

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
code, esp, simple
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 06:07 PM.