Hello, i have pretty weird problem. i am getting "unidentified external symbol" error which i CAN'T fix. First of all i will put here code of filled spread crosshair and mark you where is that error and how i am trying to fix it.
CVisuals code:
Code:
void CVisuals::SpreadCrosshair()
{
IClientEntity *pLocal = hackManager.pLocal();
CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());
IClientEntity* WeaponEnt = Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());
if (!hackManager.pLocal()->IsAlive())
return;
if (!GameUtils::IsBallisticWeapon(pWeapon))
return;
if (pWeapon == nullptr)
return;
int xs;
int ys;
Interfaces::Engine->GetScreenSize(xs, ys);
xs /= 2; ys /= 2;
auto accuracy = pWeapon->GetInaccuracy() * 550.f; //3000
Render::FilledCircle((xs / 2, ys / 2, 0), 30, accuracy, Color(255, 255, 255, 255));
if (pLocal->IsAlive())
{
if (pWeapon)
{
float inaccuracy = pWeapon->GetInaccuracy() * 1000;
char buffer4[64];
//sprintf_s(buffer4, "Inaccuracy: %f", inaccuracy);
//Render::Text(xs + accuracy + 4, ys, Color(255, 255, 255, 255), Render::Fonts::ESP, buffer4);
}
}
else
{
//Render::Text(10, 70, Color(255, 255, 255, 255), Render::Fonts::ESP, "Inaccuracy: --");
}
}
I need to put somewhere code of Render::FilledCircle and Textured Polygon, i put it to RenderManager.cpp:
Code:
#define M_PI 3.1415926535897
void Render::FilledCircle(Vector2D position, float points, float radius, Color color)
{
std::vector<Vertex_t> vertices;
float step = (float)M_PI * 2.0f / points;
for (float a = 0; a < (M_PI * 2.0f); a += step)
vertices.push_back(Vertex_t(Vector2D(radius * cosf(a) + position.x, radius * sinf(a) + position.y)));
Render::TexturedPolygon((int)points, vertices.data(), color);
}
void Render::TexturedPolygon(int n, Vertex_t* vertice, Color col)
{
static int texture_id = surface->CreateNewTextureID(true); // Identificator "surface" isn't defined.
static unsigned char buf[4] = { 255, 255, 255, 255 };
surface->DrawSetTextureRGBA(texture_id, buf, 1, 1); //Identificator "surface" isn't defined.
surface->DrawSetColor(col); //Identificator "surface" isn't defined.
surface->DrawSetTexture(texture_id); //Identificator "surface" isn't defined.
surface->DrawTexturedPolygon(n, vertice); //Identificator "surface" isn't defined.
}
So yes, this is my problem, i can fix it with simple code "extern ISurface* surface;" but there is next problem 2 errors: LNK2001/1120.
Can somebody please help me with this? i can't put this code anywhere without getting LNK errors. Thank you all before.
- - - Updated - - -
error fixed, but it's crashing