2023-07-22 16:05:47 +02:00
|
|
|
|
2023-07-22 16:23:15 +02:00
|
|
|
#include "features.h"
|
2023-07-22 16:05:47 +02:00
|
|
|
#include "../include/globals.h"
|
|
|
|
|
#include "../include/cvars.h"
|
2023-07-22 16:15:57 +02:00
|
|
|
#include "../include/util.h"
|
2023-07-22 16:05:47 +02:00
|
|
|
|
|
|
|
|
void esp(void) {
|
|
|
|
|
if (!CVAR_ON(esp))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Iterate all clients */
|
|
|
|
|
for (int i = 1; i <= i_engine->GetMaxClients(); i++) {
|
|
|
|
|
cl_entity_t* ent = i_engine->GetEntityByIndex(i);
|
|
|
|
|
|
|
|
|
|
if (!valid_client(ent) || vec_is_zero(ent->origin))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
float screen_point[2];
|
|
|
|
|
if (world_to_screen(ent->origin, screen_point)) {
|
2023-07-22 16:15:57 +02:00
|
|
|
/* TODO: Draw name at bottom-left of box ESP */
|
2023-07-22 16:05:47 +02:00
|
|
|
i_engine->pfnDrawSetTextColor(1, 1, 1);
|
|
|
|
|
i_engine->pfnDrawConsoleString(screen_point[0], screen_point[1],
|
|
|
|
|
get_name(ent->index));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|