dphome
Well-known member
Code:
void espBox1()
{
if (cheat_state->_generic.cheat_panic_enabled)
return;
if (gta_menu_active())
return;
if (!g_dwSAMP_Addr || !g_SAMP || !g_Players)
return;
if (!pGameInterface)
return;
if (isBadPtr_GTA_pPed(pPedSelf))
return;
for (int i = 0; i < SAMP_MAX_PLAYERS; i++)
{
if (g_Players->iIsListed[i] != 1)
continue;
if (i == g_Players->sLocalPlayerID)
continue;
actor_info *info = getGTAPedFromSAMPPlayerID(i);
if (info == NULL)
continue;
CPed *pPed = pGame->GetPools()->GetPed((DWORD*)info);
if (pPed == nullptr)
continue;
CVector vHead, vFoot;
pPed->GetBonePosition((eBone)BONE_HEAD, &vHead);
pPed->GetBonePosition((eBone)BONE_LEFTFOOT, &vFoot);
D3DXVECTOR3 headPos{ vHead.fX, vHead.fY, vHead.fZ }, footPos{ vFoot.fX, vFoot.fY, vFoot.fZ };
D3DXVECTOR3 headScreenPos, footScreenPos;
CalcScreenCoors(&headPos, &headScreenPos);
CalcScreenCoors(&footPos, &footScreenPos);
if (headScreenPos.z < 1.f || footScreenPos.z < 1.f)
continue;
float tmp = pow((headScreenPos.x - footScreenPos.x), 2);
float tmp2 = pow((headScreenPos.y - footScreenPos.y), 2);
float height = (sqrt(tmp + tmp2)) * 1.2f;
float width = height / 2.0f;
D3DCOLOR boxColor = D3DCOLOR_XRGB(255, 165, 0);
float x = headScreenPos.x - (width / 142.0f);
float y = headScreenPos.y + (height / 8.0f) * 3.0f;
float w = width;
float h = height;
x -= (w / 2);
y -= (h / 2);
int le = w / 4;
if (le > (h / 4))
le = (h / 4);
if (!set.espbox1)
continue;
if (set.espbox1)
{
render->D3DLine(x, y, x + le, y, boxColor);
render->D3DLine(x, y, x, y + le, boxColor);
render->D3DLine(x + w, y, x + w - le, y, boxColor);
render->D3DLine(x + w, y, x + w, y + le, boxColor);
render->D3DLine(x, y + h, x, y + h - le, boxColor);
render->D3DLine(x, y + h, x + le, y + h, boxColor);
render->D3DLine(x + w, y + h, x + w - le, y + h, boxColor);
render->D3DLine(x + w, y + h, x + w, y + h - le, boxColor);
}
}
}
Code:
void espBox2()
{
if (gta_menu_active())
return;
// Exit this function and enable samp nametags, if panic key
if (!g_dwSAMP_Addr || !g_SAMP || !g_Players)
return;
// don't run during certain samp events
if (g_dwSAMP_Addr && g_SAMP)
{
if (
// Scoreboard open?
(GetAsyncKeyState(VK_TAB) < 0 && set.d3dtext_score)
|| g_Scoreboard->iIsEnabled
// F10 key down?
|| GetAsyncKeyState(VK_F10) < 0
)
return;
}
// don't run if the CGameSA doesn't exist
if (!pGameInterface)
return;
// don't run if we don't exist
if (isBadPtr_GTA_pPed(pPedSelf))
return;
for (int playerid = 0; playerid < SAMP_MAX_PLAYERS; playerid++)
{
actor_info * player = getGTAPedFromSAMPPlayerID(playerid);
actor_info * me = actor_info_get(ACTOR_SELF, NULL);
if (!player)
continue;
if (me == player)
continue;
CPed *pPed = pGameInterface->GetPools()->GetPed((DWORD*)player);
if (!pPed)
return;
float
max_up_val = 0,
max_down_val = 0,
max_left_val = 0,
max_right_val = 0;
bool invalid = false;
for (int bone_id = BONE_PELVIS1; bone_id <= BONE_RIGHTFOOT; ++bone_id)
{
if (bone_id >= BONE_PELVIS1 && bone_id <= BONE_HEAD ||
bone_id >= BONE_RIGHTUPPERTORSO && bone_id <= BONE_RIGHTTHUMB ||
bone_id >= BONE_LEFTUPPERTORSO && bone_id <= BONE_LEFTTHUMB ||
bone_id >= BONE_LEFTHIP && bone_id <= BONE_LEFTFOOT ||
bone_id >= BONE_RIGHTHIP && bone_id <= BONE_RIGHTFOOT)
{
CVector bone;
pPed->GetBonePosition((eBone)bone_id, &bone);
D3DXVECTOR3 bone_pos;
bone_pos.x = bone.fX;
bone_pos.y = bone.fY;
bone_pos.z = bone.fZ;
D3DXVECTOR3 bone_screen_pos;
CalcScreenCoors(&bone_pos, &bone_screen_pos);
// check if the iter is culled or not
if (bone_screen_pos.z < 1.f)
{
invalid = true;
break;
}
if (!max_up_val && !max_down_val &&
!max_left_val && !max_right_val)
{
max_up_val = bone_screen_pos.y;
max_down_val = bone_screen_pos.y;
max_right_val = bone_screen_pos.x;
max_left_val = bone_screen_pos.x;
}
if (bone_screen_pos.y > max_up_val)
max_up_val = bone_screen_pos.y;
if (bone_screen_pos.y < max_down_val)
max_down_val = bone_screen_pos.y;
if (bone_screen_pos.x > max_right_val)
max_right_val = bone_screen_pos.x;
if (bone_screen_pos.x < max_left_val)
max_left_val = bone_screen_pos.x;
}
}
if (!invalid)
{
float height_box = max_up_val - max_down_val;
float widht_box = max_right_val - max_left_val;
if (set.espbox2)
{
D3DCOLOR color;
color = D3DCOLOR_XRGB(255, 165, 0);
render->D3DBoxBorder(max_left_val /*- width_offset / 2*/,
max_down_val /*- height_offset / 2*/,
widht_box /*+ width_offset*/,
height_box /*+ height_offset*/, color, 0);
}
}
}
}
Code:
void espSkelet()
{
if (gta_menu_active())
return;
if (cheat_state->_generic.cheat_panic_enabled)
return;
if (!set.espskelet)
return;
for (int playerid = 0; playerid < SAMP_MAX_PLAYERS; playerid++)
{
actor_info * player = getGTAPedFromSAMPPlayerID(playerid);
actor_info * me = actor_info_get(ACTOR_SELF, NULL);
if (!player)
continue;
if (me == player)
continue;
CPed *pPed = pGameInterface->GetPools()->GetPed((DWORD*)player);
if (!pPed)
return;
CVector vecBone[55];
for (int iBone = BONE_PELVIS1; iBone <= BONE_RIGHTFOOT; iBone++)
{
switch (iBone)
{
case 5: case 4: case 22: case 32: case 23: case 33: case 24: case 34: case 25: case 26: case 35: case 36: case 3: case 2: case 52: case 42: case 53: case 43: case 54: case 44:
pPed->GetBonePosition((eBone)iBone, &vecBone[iBone]);
break;
}
}
if (render)
{
D3DCOLOR color;
color = D3DCOLOR_XRGB(255, 165, 0);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_NECK]), CVecToD3DXVEC(vecBone[BONE_UPPERTORSO]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_UPPERTORSO]), CVecToD3DXVEC(vecBone[BONE_RIGHTSHOULDER]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_UPPERTORSO]), CVecToD3DXVEC(vecBone[BONE_LEFTSHOULDER]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTSHOULDER]), CVecToD3DXVEC(vecBone[BONE_LEFTELBOW]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTSHOULDER]), CVecToD3DXVEC(vecBone[BONE_RIGHTELBOW]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTELBOW]), CVecToD3DXVEC(vecBone[BONE_LEFTWRIST]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTELBOW]), CVecToD3DXVEC(vecBone[BONE_RIGHTWRIST]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTWRIST]), CVecToD3DXVEC(vecBone[BONE_LEFTHAND]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTHAND]), CVecToD3DXVEC(vecBone[BONE_LEFTTHUMB]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTWRIST]), CVecToD3DXVEC(vecBone[BONE_RIGHTHAND]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTHAND]), CVecToD3DXVEC(vecBone[BONE_RIGHTTHUMB]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_UPPERTORSO]), CVecToD3DXVEC(vecBone[BONE_SPINE1]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_SPINE1]), CVecToD3DXVEC(vecBone[BONE_PELVIS]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_PELVIS]), CVecToD3DXVEC(vecBone[BONE_RIGHTKNEE]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_PELVIS]), CVecToD3DXVEC(vecBone[BONE_LEFTKNEE]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTKNEE]), CVecToD3DXVEC(vecBone[BONE_RIGHTANKLE]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTKNEE]), CVecToD3DXVEC(vecBone[BONE_LEFTANKLE]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_RIGHTANKLE]), CVecToD3DXVEC(vecBone[BONE_RIGHTFOOT]), color);
render->DrawLine(CVecToD3DXVEC(vecBone[BONE_LEFTANKLE]), CVecToD3DXVEC(vecBone[BONE_LEFTFOOT]), color);
}
}
}
Code:
void espTracers()
{
traceLastFunc("espTracers()");
if (gta_menu_active())
return;
if (cheat_state->_generic.cheat_panic_enabled)
return;
// Exit this function and enable samp nametags, if panic key
if (!g_dwSAMP_Addr || !g_SAMP || !g_Players)
return;
// don't run if the CGameSA doesn't exist
if (!pGameInterface)
return;
// don't run if we don't exist
if (isBadPtr_GTA_pPed(pPedSelf))
return;
if (!set.esptracers)
return;
for (int playerid = 0; playerid < SAMP_MAX_PLAYERS; playerid++)
{
actor_info * player = getGTAPedFromSAMPPlayerID(playerid);
actor_info * me = actor_info_get(ACTOR_SELF, NULL);
if (!player)
continue;
if (me == player)
continue;
CPed *pPed = pGameInterface->GetPools()->GetPed((DWORD*)player);
if (!pPed)
return;
CVector mySpinePos, TargetSpinePos;
pPedSelf->GetBonePosition(BONE_PELVIS1, &mySpinePos);
pPed->GetBonePosition(BONE_PELVIS1, &TargetSpinePos);
D3DCOLOR color;
color = D3DCOLOR_XRGB(255, 165, 0);
if (render)
render->DrawLine(CVecToD3DXVEC(mySpinePos), CVecToD3DXVEC(TargetSpinePos), color);
}
}
Last edited: