Hello guys,
I'm learning stuff while coding my first internal project. I've made Aimbot, ESP, Skinchanger, Nade Tracer and i saw one thing called Grenade Prediction - It will show you trace of grenade before you throw it.. The question is -> Is there some source which contains this function? I watched some snippets with this function (Found two, both from 2014 and both were using unknown function names so i could not understand how the thing works)..

2. I have never done it myself. Nor have i looked at a source with it. But if i had to venture a guess i would say you are going to need a LOT of math. And a good bit of knowledge/research of the source engine. I'm thinking (could be wrong) you just replicate the math of the grenade (including ray tracing to detect objects it may bounce off of) and draw lines accordingly. But maybe there is a simpler way. Really not sure. Good luck bro lol.

3. Find the function like Grenade::Attack() or Fire() or whatever, simulate it by defining your own objects and parameters, call it using your simulated grenade, in this manner it won't affect your player or the game. Then plot the path of the grenade based on whatever you log from the simulated function call. You'll have to be a good ass reverser to do this

4. According to what you say, I will just skip this function because it seems to be above my coding skills for now.
Thanks for replies guys, I appreciate it..
You can lock this thread if you want, i got what i wanted^^

5. After few hours i finished Grenade Prection code (based on dude719's code on UC)
It's not pixel-perfect but w/e, it's enough for me
Code:
```void PredictGrenade(CBaseEntity* pLocal)
{
const float TIMEALIVE = 5.f;

float fStep = 0.1f;
float fGravity = 800.0f / 8.f;

Vector3 vPos, vThrow, vThrow2;
Vector3 vStart;

int iCollisions = 0;

Vector3 vViewAngles;
I::Engine->GetViewAngles(vViewAngles);

vThrow[0] = vViewAngles[0];
vThrow[1] = vViewAngles[1];
vThrow[2] = vViewAngles[2];

if (vThrow[0] < 0)
vThrow[0] = -10 + vThrow[0] * ((90 - 10) / 90.0);
else
vThrow[0] = -10 + vThrow[0] * ((90 + 10) / 90.0);

float fVel = (90 - vThrow[0]) * 4;
if (fVel > 500)
fVel = 500;

U::AngleVectors2(vThrow, &vThrow2);

Vector3 vEye = pLocal->GetEyePosition();
vStart[0] = vEye[0] + vThrow2[0] * 16;
vStart[1] = vEye[1] + vThrow2[1] * 16;
vStart[2] = vEye[2] + vThrow2[2] * 16;

vThrow2[0] = (vThrow2[0] * fVel) + pLocal->GetVelocity()[0];
vThrow2[1] = (vThrow2[1] * fVel) + pLocal->GetVelocity()[1];
vThrow2[2] = (vThrow2[2] * fVel) + pLocal->GetVelocity()[2];

for (float fTime = 0.0f; fTime < TIMEALIVE; fTime += fStep)
{
vPos = vStart + vThrow2 * fStep;

Ray_t ray;
trace_t tr;
CTraceFilter loc;
loc.pSkip = pLocal;

ray.Init(vStart, vPos);
Color color = Color(0, 255, 0);
if (tr.DidHit())
{
float anglez = DotProduct(Vector3(0, 0, 1), tr.plane.normal);
float invanglez = DotProduct(Vector3(0, 0, -1), tr.plane.normal);
float angley = DotProduct(Vector3(0, 1, 0), tr.plane.normal);
float invangley = DotProduct(Vector3(0, -1, 0), tr.plane.normal);
float anglex = DotProduct(Vector3(1, 0, 0), tr.plane.normal);
float invanglex = DotProduct(Vector3(3-1, 0, 0), tr.plane.normal);
float scale = tr.endpos.DistTo(pLocal->GetOrigin()) / 60;
Color color = Color(0, 0, 255);
if (anglez > 0.5)
{
tr.endpos.z += 1;
Vector3 startPos = tr.endpos + Vector3(-scale, 0, 0);
Vector3 endPos = tr.endpos + Vector3(scale, 0, 0);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(0, -scale, 0);
endPos = tr.endpos + Vector3(0, scale, 0);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}
else if (invanglez > 0.5)
{
tr.endpos.z += 1;
Vector3 startPos = tr.endpos + Vector3(-scale, 0, 0);
Vector3 endPos = tr.endpos + Vector3(scale, 0, 0);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(0, -scale, 0);
endPos = tr.endpos + Vector3(0, scale, 0);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}
else if (angley > 0.5)
{
tr.endpos.y += 1;
Vector3 startPos = tr.endpos + Vector3(0, 0, -scale);
Vector3 endPos = tr.endpos + Vector3(0, 0, scale);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(-scale, 0, 0);
endPos = tr.endpos + Vector3(scale, 0, 0);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}
else if (invangley > 0.5)
{
tr.endpos.y += 1;
Vector3 startPos = tr.endpos + Vector3(0, 0, -scale);
Vector3 endPos = tr.endpos + Vector3(0, 0, scale);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(-scale, 0, 0);
endPos = tr.endpos + Vector3(scale, 0, 0);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}
else if (anglex > 0.5)
{
tr.endpos.x += 1;
Vector3 startPos = tr.endpos + Vector3(0, -scale, 0);
Vector3 endPos = tr.endpos + Vector3(0, scale, 0);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(0, 0, -scale);
endPos = tr.endpos + Vector3(0, 0, scale);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}
else if (invanglex > 0.5)
{
tr.endpos.x += 1;
Vector3 startPos = tr.endpos + Vector3(0, -scale, 0);
Vector3 endPos = tr.endpos + Vector3(0, scale, 0);
Vector3 outStart, outEnd;
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))

startPos = tr.endpos + Vector3(0, 0, -scale);
endPos = tr.endpos + Vector3(0, 0, scale);
if (U::WorldToScreen(startPos, outStart) && U::WorldToScreen(endPos, outEnd))
}

vThrow2 = tr.plane.normal * -2.0f * DotProduct(vThrow2, tr.plane.normal) + vThrow2;

iCollisions++;
if (iCollisions > 2)
break;

vPos = vStart + vThrow2 * tr.fraction * fStep;
fTime += (fStep * (1 - tr.fraction));
}

Vector3 vOutStart, vOutEnd;

if (U::WorldToScreen(vStart, vOutStart), U::WorldToScreen(vPos, vOutEnd))
Draw->AddLine(ImVec2(vOutStart.x, vOutStart.y), ImVec2(vOutEnd.x, vOutEnd.y), Color(0, 255, 0).GetU32());

vStart = vPos;
vThrow2.z -= fGravity * tr.fraction * fStep;
}
}```

6. @yolomaw holy shit that's alot of code! Nice job getting it to work. Just curious, could you create a fake grenade object, call the game's "Throw grenade" function on it and use that to predict the results? That's what I always imagined doing rather than writing the whole function myself