void renderVehicleInfo()
{
traceLastFunc("renderVehicleInfo()");
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;
for (int i = 0; i < SAMP_MAX_VEHICLES; i++)
{
vehicle_info *vehicle = getGTAVehicleFromSAMPVehicleID(i);
const struct vehicle_entry *evehicle;
if (!vehicle)
continue;
if (g_Vehicles->iIsListed[i] != 1)
continue;
D3DXVECTOR3 vehicle_pos, screenposs;
float * f_pos = &vehicle->base.matrix[4 * 3];
vehicle_pos.x = f_pos[0];
vehicle_pos.y = f_pos[1];
vehicle_pos.z = f_pos[2];
CalcScreenCoors(&vehicle_pos, &screenposs);
char buf[256];
char pos[256], ping[256], hparmw[256];
evehicle = gta_vehicle_get_by_id(g_Vehicles->pSAMP_Vehicle[i]->pGTA_Vehicle->base.model_alt_id);
if (NewSobeit->bVehicleInfo)
{
if (screenposs.z < 1.f)
continue;
_snprintf_s(buf, sizeof(buf) - 1, "{C235DD}Vehicle{FFFFFF} %s Model %d", evehicle->name, evehicle->id);
pD3DFont_sampStuff->PrintShadow(screenposs.x, screenposs.y - 38, COLOR_WHITE(255), buf);
_snprintf_s(hparmw, sizeof(hparmw) - 1, "{F0FF0F}Health{FFFFFF} %d{FF0F0F} Explode Timer{FFFFFF} %0.0f/2276", (int)(g_Vehicles->pSAMP_Vehicle[i]->pGTA_Vehicle->hitpoints /10), g_Vehicles->pSAMP_Vehicle[i]->pGTAEntity->burn_timer);
pD3DFont_sampStuff->PrintShadow(screenposs.x, screenposs.y - 26, COLOR_WHITE(255), hparmw);
_snprintf_s(ping, sizeof(ping) - 1, "{F0FF0F}Passanger Seats{FFFFFF} <%d> {00FF00} Distance{FFFFFF} %.0f m", g_Vehicles->pSAMP_Vehicle[i]->pGTA_Vehicle->m_nMaxPassengers, GetDistance(D3DXVECTOR3(vehicle_pos.x, vehicle_pos.y, vehicle_pos.z)));
pD3DFont_sampStuff->PrintShadow(screenposs.x, screenposs.y - 14, COLOR_WHITE(255), ping);
_snprintf_s(pos, sizeof(pos) - 1, "Pos X %0.02f Y %0.02f Z %0.02f", vehicle_pos.x, vehicle_pos.y, vehicle_pos.z);
pD3DFont_sampStuff->PrintShadow(screenposs.x, screenposs.y, COLOR_WHITE(255), pos);
}
}
}