Jump to content

[CODE] CRadar (FAR ESP)


Syran0

Recommended Posts

radar based far esp

 

struct CRadarPlayer
{
__int32 bIsValid; //0000  -> not updating that much?!
char unknown0[12];
char Unknown1[32]; //0010
__int32 iTeam; //0030
__int32 iHealth; //0034
Vector vOrigin; //0038
QAngle qViewAngles; //0044
};

 

void __stdcall new_PaintTraverse(vgui::VPANEL vguiPanel, bool forceRepaint, bool allowForce)
{
_asm
{
	PUSH allowForce
	PUSH forceRepaint
	PUSH vguiPanel
	MOV ECX, g_pPanel
	CALL g_dwOrgPaintTraverse
}

//"MatSystemTopPanel"
const char* pszPanelName = g_pPanel->GetName(vguiPanel);
if(pszPanelName[0] == 'M' 
&& pszPanelName[3] == 'S' 
&& pszPanelName[9] == 'T'
&& pszPanelName[12] == 'P')
{
	CBaseEntity* pLocal = (CBaseEntity*)g_pEntList->GetClientEntity(g_pEngine->GetLocalPlayer());
	if(pLocal && pLocal->IsAlive() && g_pEngine->IsInGame())
	{
	    CRadarPlayer* pRadarPlayer = NULL;
	    player_info_t pInfo;
	    int iTeam = 0;
	    int r = 255, g = 255, b = 255;
	    Vector vPlayer, vScreen;
	    float fDistanceToPlayer;
	    float fBoxradius;

	    for(int index = 0; index < 32; index++)
	    {
	    	if(index == g_pEngine->GetLocalPlayer() - 1) continue;

	    	_asm
	    	{
	    		MOV ECX,DWORD PTR DS:[244035C0h]
	    		MOV EAX, index
	    		LEA EAX,DWORD PTR DS:[EAX+EAX*4]
	    		SHL EAX,6
	    		LEA EAX,DWORD PTR DS:[EAX+ECX+28h]
	    		MOV pRadarPlayer, EAX
	    	}

		    if(pRadarPlayer == NULL 
		    || (pRadarPlayer->vOrigin.x == 0 && pRadarPlayer->vOrigin.y == 0 && pRadarPlayer->vOrigin.z == 0)
		    || pRadarPlayer->iTeam == 0
		    || pRadarPlayer->iHealth == 0) continue;

	    	iTeam = pRadarPlayer->iTeam;

	    	vPlayer = pRadarPlayer->vOrigin;

		    if(vPlayer.z == (int)vPlayer.z) vPlayer.z += 32;
		    else vPlayer.z -= 32;

	    	if(gNeeded.GetVisible(pLocal->EyePosition(), vPlayer) == false)
	    	{
			    if(iTeam == 2)
			    {
			    	r = 255;
		    		g = 80;
			    	b = 60;
		    	}
		    	else if(iTeam == 3)
		    	{
		    		r = 80;
		    		g = 80;
		    		b = 255;
		    	}
			    else
			    {
			    	r = 255;
			    	g = 255;
			    	b = 255;
		    	}
		    }
		    else
		    {
			    if(iTeam == pLocal->GetTeamNumber())
			    {
			    	if(iTeam == 2)
			    	{
				    	r = 255;
				    	g = 80;
				    	b = 60;
				    }
				    if(iTeam == 3)
				    {
				    	r = 80;
				    	g = 80;
				    	b = 255;
			    	}
			    }
		    	else 
		    	{
		    		r = 150;
		    		g = 255;
		    		b = 60;
		    	}
	    	}

	    	if(gNeeded.WorldToScreen(vPlayer, vScreen))
	    	{
	    	    fDistanceToPlayer = gNeeded.GetDistance(pLocal->GetAbsOrigin(), vPlayer);
	    		fBoxradius = (100 / (fDistanceToPlayer / 100));

	    		g_pMatSystemSurface->DrawSetColor(r, g, b, 210);
	    		g_pMatSystemSurface->DrawOutlinedRect(vScreen.x - fBoxradius, vScreen.y - fBoxradius, vScreen.x + fBoxradius, vScreen.y + fBoxradius );
	    	}
	    }
	}
}
}

 

avitamin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...